We have a process wherein we send a file and some minutes later receive another file in response. The process is synchronous, meaning we don’t send a file until we receive the response to the previous file.
We keep requests and responses in separate directories. We can determine the health of our system by examining the creation dates of the most recent file in each directory. If we have sent a file at time X and don’t receive a response by X+minutes, we know there’s an issue. I’d like Nagios to send an email to our help desk in this case.
Can Nagios grab file creation dates and compare them? The Nagios guy at our company says it can’t do it. I am not believing it.
My google-fu is too weak to find answers to this question.
I don’t think there is a suitable out-of-the-box plugin for that, but writing your own Nagios plugins is really easy – the API is in its simplest form that your program (written in anything that can execute on the Nagios host) has to do this:
If your Nagios administrator don’t want custom plugins, you aren’t out of options. If you can publish the current state of the process you want to monitor on a web server, the standard plugin
check_httpcan be configured to look for certain strings on a web page.You could also make use of passive checks, having your program feed the Nagios machine with test results either directly via the
external_command_fileor via a HTTP POST in the web interface.