<p>Another option is to use <a href="https://sensuapp.org/" rel="nofollow noreferrer">Sensu</a>. There are several plugins including a <a href="https://github.com/sensu-plugins/sensu-plugins-http" rel="nofollow noreferrer">http one</a>, that is able to check whether a response contains a certain string:</p>

<blockquote>
  <p>check-http.rb -u <a href="http://my.site.com/health" rel="nofollow noreferrer">http://my.site.com/health</a> -q 'OK'</p>
</blockquote>

CC BY-SA 3.0
2017-10-27T12:13:41.927Z
2017-10-27T14:09:59.723Z
2017-10-27T14:09:59.723Z
030
<p>Try <a href="https://dev.to/melezhik/sparky---powerful-pocket-size-task-runner-server-in-crontab-style-2ed5" rel="nofollow noreferrer">Sparky</a>. 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 <a href="https://github.com/melezhik/sparrowdo/blob/master/core-dsl.md" rel="nofollow noreferrer">DSL</a> ( written on Perl6 ), for example:</p>

<p>"Does a file, with a maximum age, exist on some network share?"</p>

<pre><code>bash "find file.txt -mmin -10", %( expect_stdout =&gt; "file.txt" );
</code></pre>

<p>"Does the response-body of a HTTP-request match a specific regex?"</p>

<pre><code>http-ok 'http://sparrowhub.org', %( has-content =&gt; 'SparrowHub' );
</code></pre>

<p>And yet if it's not enough it's easy to create extensions.</p>

<p>PS Sparky only supports linux for now ...</p>

CC BY-SA 4.0
2018-11-02T16:40:45.730Z
2018-11-05T18:22:26.230Z
2018-11-05T18:22:26.230Z
Alexey Melezhik
<p>All in all any monitoring tool would do for this case, <a href="https://mmonit.com/monit/" rel="noreferrer">monit</a>, <a href="https://www.nagios.org/" rel="noreferrer">nagios</a>, <a href="https://www.shinken-monitoring.org/" rel="noreferrer">shinken</a>, <a href="https://www.icinga.com/" rel="noreferrer">icinga</a>, <a href="https://www.centreon.com/" rel="noreferrer">centreon</a>, or even a crontab in bash could do...</p>

CC BY-SA 3.0
2017-10-27T14:21:08.807Z
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
CC BY-SA 4.0
2018-11-03T04:51:54.903Z
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
CC BY-SA 4.0
2018-11-05T08:51:30.830Z
@JiriKlouda My first take for this question would be monit (hence why I gave it first in the list)
Tensibai
CC BY-SA 3.0
2017-10-27T09:14:49.030Z
2017-10-27T09:22:22.810Z
2017-10-27T09:22:22.810Z
Tensibai
<p>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.</p>

<p><strong>These are examples of checks that I would like to monitor automatically:</strong></p>

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

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

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

<monitoring><logging><operations>
Automatic periodic conditional checks
Silas Hansen
# Automatic periodic conditional checks

(Asked by: username_0 on 2017-10-27)

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.

**Tags:** monitoring, logging, operations


---

## 3 answers

### Answer by username_3 on 2017-10-27. Score: 9 | Accepted answer

All in all any monitoring tool would do for this case, [monit](https://mmonit.com/monit/), [nagios](https://www.nagios.org/), [shinken](https://www.shinken-monitoring.org/), [icinga](https://www.icinga.com/), [centreon](https://www.centreon.com/), or even a crontab in bash could do...

> **Comments:**
> **username_0**: 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.  
> **username_4**: 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...  
> **username_3**: @JiriKlouda My first take for this question would be monit (hence why I gave it first in the list)  

---

### Answer by username_1 on 2017-10-27. Score: 2

Another option is to use [Sensu](https://sensuapp.org/). There are several plugins including a [http one](https://github.com/sensu-plugins/sensu-plugins-http), that is able to check whether a response contains a certain string:

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


---

### Answer by username_2 on 2018-11-02. Score: 2

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 ...


---

