Skip to content

Instantly share code, notes, and snippets.

@jeffcasavant
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffcasavant/7260402e8f95c5ac2cb3 to your computer and use it in GitHub Desktop.
Save jeffcasavant/7260402e8f95c5ac2cb3 to your computer and use it in GitHub Desktop.
<?php
if (!isset($_GET['plaintext'])){
print('<html>
<head>
<title>JeffCasavant.com Service Status</title>
</head>
<body>
<pre>');
}
$mask = " %-10s %7s %7s\n";
printf($mask, 'Service', 'Running', 'Total');
printf($mask, 'Gitlab', exec('ps aux | grep -v grep | grep -c /var/log/gitlab'), '9');
printf($mask, 'RethinkDB', exec('ps aux | grep -v grep | grep -c rethink'), '2');
if (!isset($_GET['plaintext'])){
print('</pre>
</body>
</html>
');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment