Passive check is not updating the nagios site

monitoringnagios

The definition for the passive check seem to be corrected. I setup a cron job to run every 5 minutes and execute the script where the output is processed using:

command_file=/var/spool/nagios/cmd/nagios.cmd

[timestamp] PROCESS_SERVICE_CHECK_RESULT;host_name;svc_description;return_code;plugin_output >> $command_file

These things are confirmed:

  • check_external_command=1
  • accept_passive_service_checks=1
  • passive_checks_enabled is set

Check_dummy definition is defined like example

define command{
    command_name    no-backup-report
    command_line    /usr/local/nagios/libexec/check_dummy 3 $ARG1$
    }

etc.

After a full commit and updates, file installs and nagios restart, no errors are generated, however, the check doesn't update the nagios site with the appropriate information.

This is the first time setting up a passive check, so any input will be appreciated.

Best Answer

I resolved this issue once I realized that the path within script that sends the output to the nagios.cmd file was not enclosed with "".

Old: command_file=/var/spool/nagios/cmd/nagios.cmd

new: command_file="/var/spool/nagios/cmd/nagios.cmd"

That fixed the issue. Can't believe I missed that..

Related Topic