Linux-Unix File Existence

This template returns whether or not files exist on the target computer.

Prerequisites: SSH and Perl installed on the target server.

Credentials: Root user on the target server.


Monitored Components

Linux-Unix File Existence

This monitor returns whether files on the target server exist (1) or do not exist (0).

Note: Before using this monitor, the correct arguments should be set. This monitor requires the following arguments:

perl ${SCRIPT} path_to_file
where

path_to_file
This is full path to target file. Regular expressions are allowed here.

Below is an example using the Scripts Arguments field:
perl ${SCRIPT} /tmp/product*

Last updated 12/2/2014

  • Is there a similar script that has the logic in reverse?

    So : IF file DOES NOT EXIST status is UP/GREEN.

    The reason for asking is that our developers are creating some scripts which, will create a file in the event of an error on their system.  So in this case, if there is no file its an up status.  If a file does exist the monitoring status would be down.

    EDITED - I have coped the script and just amended it to provide the output I wanted above.