Nagios no data returned from plugin, check_apt only

nagiosnrpe

I have a very odd problem with Nagios. For some reason the check_apt seems to be failing and I dont know why. It acts like it's not running the check at all.

I have nrpe running on the box development and all other checks are running fine. On the box with nagios installed the definition is as follows.

define service{
    use                             generic-service         
    host_name                       development
    service_description             APT
    check_command                   check_nrpe!check_apt
    }

On "development" the nrpe.cfg contains the following line.

command[check_apt]=/usr/lib/nagios/plugins/check_apt -n

Furthermore if I am on the box with Nagios installed and I execute the following it works!

/usr/lib/nagios/plugins/check_nrpe -H development -c check_apt

which returns

APT OK: 0 packages available for upgrade (0 critical updates).

So, what is wrong here? It would seem that other NRPE plugins are working fine, only APT seems to fail and running it manually on the box seems to work. Suggestions?

Best Answer

The problem I discovered was in the service description, although I think there is either a bug or an option in Nagios not being specified. The debug output showed the actual command line being run to NRPE

/usr/lib/nagios/plugins/check_nrpe -H server.mechsoft-vps1.com -c check_mysqld -a

The problem here is that -a requires a parameter. The check however does not. Changing the service definition to add a parameter fixed the problem.

define service{
    use                             generic-service         
    host_name                       development
    service_description             APT
    check_command                   check_nrpe!check_apt!1
    }
Related Topic