[Nagiosplug-help] plugin not returning variable value

Thomas Guyot-Sionnest dermoth at aei.ca
Fri Mar 9 05:49:16 CET 2007


On 06/03/07 03:06 PM, Ingo Lantschner wrote:
> Am 05.03.2007 um 17:33 schrieb Andrew Hall:
> 
>> Which when run on the local machine returns...
>>
>> OK: 658 connections left
>>
>> But when run from the nagios server only returns...
>>
>> OK:  connections left
>>
>> Missing out the value of the $Difference variable
>>
>> Can anyone explain why this is and how I can resolve it?
> I see two possible reasons:
> 1. Different users: Did you try to run it on the local machine as the  
> same user, which runs the nrpe-daemon (probably nagios)?
> 	# su - nagios
> 	$ /usr/lib/nagios/plugins/check_max_connections -w 300 -c 100
> 
> 2. Enviroment issues: This can be solved by
>      a. using full-pathes (/usr/sbin/mysqladmin?!) or
>      b. by setting the enviroment in nrpe.cfg:
> 	command[check_max_connections]=env PATH=... LANG=... HOME=... /usr/ 
> lib/nagios/plugins/check_max_connections -w 300 -c 100

It's very likely #1, different user. When you run mysqladmin as root it
logs in MySQL as *root* without password from the UNIX socket. Mysql
default install is shiped with a paswordless local root account. This
means that running it as user mysql you will need to run this:

mysqladmin -u root

Depending on where the mysql config file is located you might need to
specify the socket as well. As suggested try running the command as user
mysql (or whichever user nrpe is set up to use) and you will likely get
a more descriptive error.

Thomas




More information about the Help mailing list