I need a simple tool that will carry out some conditional checks periodically and give me a red/green status that I can use as an indication that something is wrong.

These are examples of checks that I would like to monitor automatically:

  • Does a row exist in a database that meets a certain criteria?
  • Does a file, with a maximum age, exist on some network share?
  • Does the response-body of a HTTP-request match a specific regex?

So basically, it would free me from checking these various indicators manually and just have a red/green dashboard that I could monitor.

I'm thinking something like this has got to exist in a ready-made solution.

up vote 10 down vote accepted

All in all any monitoring tool would do for this case, monit, nagios, shinken, icinga, centreon, or even a crontab in bash could do...

  • Thank you for the list. The crontab solution is what I've defaulted to before, but as this seems like such a general requirement for ops, I thought these systems had to exist. – Silas Hansen Oct 27 '17 at 14:21
  • I would recommend Nagios. Because there so few pleasures in the life of a sysadmin and almost nothing beats the feeling you get when you finally remove the last vestige of Nagios from all your systems. Sadly to experience this extreme joy, you first need to install Nagios. So go ahead, use that... – Jiri Klouda Nov 3 at 4:51
  • @JiriKlouda My first take for this question would be monit (hence why I gave it first in the list) – Tensibai Nov 5 at 8:51

Another option is to use Sensu. There are several plugins including a http one, that is able to check whether a response contains a certain string:

check-http.rb -u http://my.site.com/health -q 'OK'

Try Sparky. This is a lightweight but powerful alternative to linux crontab. It comes with nice UI to see cronjob reports and statues. You can also run tasks remotely over ssh or through docker. The typical tasks you've mentioned are covered by existing DSL ( written on Perl6 ), for example:

"Does a file, with a maximum age, exist on some network share?"

bash "find file.txt -mmin -10", %( expect_stdout => "file.txt" );

"Does the response-body of a HTTP-request match a specific regex?"

http-ok 'http://sparrowhub.org', %( has-content => 'SparrowHub' );

And yet if it's not enough it's easy to create extensions.

PS Sparky only supports linux for now ...

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.