Create a Passive Service Test
Now the real work begins. The test script is a way to check to see if your client is connecting to the Nagios server passively. This script is placed on the client and should produce results on the Nagios server.
/bin/echo $CMD | /usr/sbin/send_nsca -H 192.168.5.50 -d ‘;’ -c $CFG
Here is a common error you will see in /var/log/messages on the Nagios server, “service could not be found”.
Sep 10 16:42:31 fw3 nagios: EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;nagpass;ssh;2;test
Sep 10 16:42:31 fw3 nagios: Warning: Passive check result was received for service ‘ssh’ on host ‘nagpass’, but the service could not be found!
The solution is all in the set up on the Nagios server and client so they are communicating correctly.
Configure the Web Interface to Accept the Passive Service Checks
In order to get the web interface working correctly you need to use a dummy service definition as Nagios requires a host/service combination to use the web interface.
Now if you closely examine the test script above you will see the CMD variable is the key to avoiding problems. The “Processes” is the name that must also be placed in the service definition on the Nagios server. The service_description is key to the communication.
Here is an example dummy service for the services.cfg.
because this is passive the check_command needs to be a dummy command. Here is the dummy command that needs to be entered into the commands.cfg file. Remember that all commands need to be defined.
When you run the test script you should see that the Nagios server is processing the information in the logs.