Critical pattern in nagios

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
patriciablue
Posts: 1
Joined: Thu Jan 15, 2026 4:08 am

Critical pattern in nagios

Post by patriciablue »

Hello,
I need to monitor the string HTTP/1.1" 404 in Nagios, so I'm using the check_logfiles plugin to set up the monitoring. Below is the definition I've created:

Code: Select all

 define service {
        service_description            Logfile_xyz 404 exception
        host_name                      xyz
        use                            generic-service
        check_command                  check_logfiles!/logfile pathpath !\\`hostname\\`_404Exception!\\\'HTTP/1.1\\" 404\\\'!6
        check_interval                 10
        contact_groups                 tivoli_xyz_high
        max_check_attempts             2
        retry_interval                 2
        servicegroups                  project_b2v_details_availability
     }
However, I'm encountering the following error:

Code: Select all

--tag=hostname_404Exception --criticalpattern='HTTP/1.1" 404' --criticalthreshold=6 --htmlencode' returned status 2.
Do you have any suggestions on how to resolve this?
Last edited by geometry dash two days ago
User avatar
lgute
Posts: 420
Joined: Mon Apr 06, 2020 2:49 pm

Re: Critical pattern in nagios

Post by lgute »

Hi @patriciablue,

Thanks for reaching out.

I have not used this plugin, so what I would with is running the plugin in a terminal/console. It is faster and easier to try options and debug this way. Looking at the error, I wonder if you need to escape a few of the characters. Maybe something like this.

Code: Select all

/usr/local/nagios/libexec/check_logfiles --logfile=/var/log/apache/access.log --tag=hostname_404Exception --criticalpattern='HTTP/1\.1\" 404' --criticalthreshold=6 --htmlencode
Please let us know if you have any other questions or concerns.

-Laura
Post Reply