build 980262fe | content blog-content@c8490fa · 338 posts | profiles 20 · corpus 208 | 0 skipped |
How-To · 2024-02-22

Monitor Cronjobs with Aria Operations

On a professional services project the customer wanted the VMware SRM backup monitored automatically, with a warning raised if the backup job ever failed. Here is how I did it.

2024-02-22Date
Dario DörflingerAuthor
2Min read
407words
no translation reviewed
Topics capabilities · idf weight Monitoring monitoring 3.08
Vendors vendors · idf weight VMware vmware 0.91

On a professional services project the customer had a requirement for the VMware SRM backup: it had to be monitored automatically and raise a warning if the backup job ever failed. This post shows how I did it.

The starting point

The project had a particular starting point.

  • An installed VMware Site Recovery Manager instance
  • An installed VMware Aria Operations instance
  • An installed VMware Aria Operations for Logs instance
  • The two integrated with each other

The requirement was to monitor that cronjob and raise a warning automatically, on the right object, if the job ever failed.

The solution

Conceptually it is very simple.

concept of cronjob monitoring with aria operations and aria operations for logs

Adjusting the cronjob

With

 crontab -e 

(as root) you edit the root user’s crontab.

There, a logger command has to be appended to the existing entry from the SRM export job’s backup setup.

2>&1 | logger -t export_sh -n syslog.soultec.ch -P 514 -T

The complete entry could then look like this:

45 15 * * * /usr/bin/sudo /bin/bash /opt/vmware/impex/bin/export.sh 2>&1 | logger -t export_sh -n syslog.soultec.ch -P 514 -T

That way, errors from the export.sh script are handed to logger, which forwards the entry to the syslog server.

Defining the alert in Aria Operations for Logs

The second step is to define an alert that also raises a warning in Aria Operations.

Aria Operations for Logs alert definition, 1 of 2

In the first section we set the text filter to “Export failed.” and the source has to contain the FQDN of our SRM server.

Within a five-minute window the alert triggers as soon as more than zero occurrences are counted, so on the first one.

Aria Operations for Logs alert definition, 2 of 2

We tick “Send to VMware Aria Operations” and set the fallback object to the SRM server. In our case the criticality is only a warning, and we have an auto cancel after 24 hours (1440 minutes). The warning disappears again if the message does not repeat within a day.

That is a cronjob monitored with the logger command, Aria Operations for Logs and Aria Operations.

Next steps

Do you have more challenges along these lines? Our team of experts is ready to help. Just get in touch, no strings attached.

You might also like