Monitor timestamps of multiple log files

How to Monitor and Alert on the Timestamp of Multiple log files

[root@monitor jbowman]#
[root@monitor jbowman]#
[root@monitor jbowman]# ./logxray localhost /var/tmp/logXray autodoc /opt/apache/httpd-2/3/2/htdocs/pkicrlpub,_ast_gap_inc__ast_ 4h 8h timestamp

OK: [ /opt/apache/httpd-2.4.2/htdocs/pkicrlpub/gap_inc_stores_issuing_ca_g1.crl,age=(0d/0h/39.6m ago) /opt/apache/httpd-2.4.2/htdocs/pkicrlpub/gap_inc_corp_root_ca_g1.crl,age=(0d/0h/39.6m ago) /opt/apache/httpd-2.4.2/htdocs/pkicrlpub/gap_inc_corp_issuing_ca_g1.crl,age=(0d/0h/39.6m ago) /opt/apache/httpd-2.4.2/htdocs/pkicrlpub/gap_inc_corp_intermediate_ca_g1.crl,age=(0d/0h/39.6m ago) ].

[root@monitor jbowman]#
[root@monitor jbowman]#
[root@monitor jbowman]#
[root@monitor jbowman]#
[root@monitor jbowman]# ./nlm  logxray  logxray-01.logrobot.net  /var/tmp/logXray  autodoc  /opt/apache/httpd-2/3/2/htdocs/pkicrlpub,_ast_gap_inc__ast_ 4h 8h timestamp

OK: [ /opt/apache/httpd-2.4.2/htdocs/pkicrlpub/gap_inc_stores_issuing_ca_g1.crl,age=(0d/0h/39.6m ago) /opt/apache/httpd-2.4.2/htdocs/pkicrlpub/gap_inc_corp_root_ca_g1.crl,age=(0d/0h/39.6m ago) /opt/apache/httpd-2.4.2/htdocs/pkicrlpub/gap_inc_corp_issuing_ca_g1.crl,age=(0d/0h/39.6m ago) /opt/apache/httpd-2.4.2/htdocs/pkicrlpub/gap_inc_corp_intermediate_ca_g1.crl,age=(0d/0h/39.6m ago) ].

[root@monitor jbowman]#
[root@monitor jbowman]#
Explanation:

        Monitor all files that have the pattern "gap_inc" in their names, under the /opt/apache/httpd-2/3/2/htdocs/pkicrlpub directory.

        Alert as Warning if the age of any of the discovered file is at least 4 hours old but less than 8 hours.

        Alert as Critical when the age of any of the discovered files is at least 8 hours old.

        The _ast_ is used to denote "*"

            Asterisks have the potential to cause problems, therefore, we allow users to use a predetermined string to reference them.

            In other words, when having to specify the path to a log file with asterisks in it, replace the asterisks with "_ast_"

            For example,

                This:

                    /opt/apache/httpd-2.4.2/htdocs/pkicrlpub/*gap_inc*

                Becomes:

                    /opt/apache/httpd-2/3/2/htdocs/pkicrlpub,_ast_gap_inc__ast_

Case Scenario:

Monitor files that have the pattern "gap_inc" in their names under the /opt/apache/httpd-2/3/2/htdocs/pkicrlpub directory.
Alert as Warning if the age of any of the discovered file is at least 4 hours old but less than 8 hours.
Alert as Critical when the age of any of the discovered files is at least 8 hours old.

The _ast_ is used to denote "*"

Asterisks have the potential to cause problems, therefore, we allow users to use a predetermined string to reference them. In other words, when having to specify the path to a log file with asterisks in it, replace the asterisks with "_ast_".

For example,

	This:
		/opt/apache/httpd-2.4.2/htdocs/pkicrlpub/*gap_inc*

	Becomes:
		/opt/apache/httpd-2/3/2/htdocs/pkicrlpub,_ast_gap_inc__ast_

Other common log monitoring scenarios