[Pkg-nagios-devel] Bug#863797: Bug#863797: monitoring-plugins-basic: unable to use check_disk inside /var/tmp

Emmanuel DECAEN Emmanuel.Decaen at xsalto.com
Wed May 31 21:05:56 UTC 2017


Le 31/05/2017 à 18:50, Sebastiaan Couwenberg a écrit :
> On 05/31/2017 06:11 PM, Emmanuel DECAEN wrote:
>> Le 31/05/2017 à 17:04, Bas Couwenberg a écrit :
>>> On 2017-05-31 16:52, Jan Wagner wrote:
>>>> Am 31.05.17 um 12:06 schrieb Emmanuel DECAEN:
>>>>> In nrpe, system wide /var/tmp is no more reachable
>>>>> $ grep "/var/tmp" /proc/11489/mountinfo
>>>>> 115 113 254:2 / /var/tmp/mysql rw,noatime,nodiratime shared:65
>>>>> master:32- xfs /dev/mapper/v1-tmp rw,attr2,inode64,noquota
>>>>> 121 113 8:5
>>>>> /tmp/systemd-private-b35c254c031041979d3126e02a0c5c51-nagios-nrpe-server.service-7xjqpw/tmp
>>>>>
>>>>> /var/tmp rw,relatime shared:66 master:28 - ext4 /dev/sda5
>>>>> rw,data=ordered
>>>> As you traced the problem yourself to nrpe, you might want to reassign
>>>> the bug to nagios-nrpe-plugin with appropriate version?
>>> If NRPE cannot execute the checkcommand that implies that the nagios
>>> user doesn't have the required permissions.
>> Command run as nagios user:
>> nagios at server:~$ /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p
>> /var/tmp/mysql
>> DISK OK - free space: /var/tmp/mysql 10187 MB (99% inode=99%);|
>> /var/tmp/mysql=42MB;8184;9207;0;10230
> This is what NRPE executes, so this is not a problem in NRPE.
>
>>> The given checkcommand is not part of the default configuration:
>>>
>>>  /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /var/tmp/mysql
>>>
>>> Which suggests that this is a configuration issue to be resolved by
>>> the administrator of the system. (e.g use sudo to execute the plugin
>>> as a users with the required permissions).
>> (It was working before upgrade)
>>
>> Using sudo :
>> $ sudo -u nagios /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p
>> /var/tmp/mysql
>> DISK OK - free space: /var/tmp/mysql 10187 MB (99% inode=99%);|
>> /var/tmp/mysql=42MB;8184;9207;0;10230
> What is the output of the check_nrpe command when you execute it (as the
> nagios user) from the monitoring host?

nagios at mon:~$  /usr/lib/nagios/plugins/check_nrpe -n -H server -c
check_tmpsqldisk
DISK CRITICAL - /var/tmp/mysql is not accessible: No such file or directory

> And what does nagios-nrpe-server log on the system where the check_disk
> command you claim fails?

May 31 22:46:45 server nrpe[31037]: Running command:
/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /var/tmp/mysql
May 31 22:46:45 server nrpe[31037]: Command completed with return code 2
and output: DISK CRITICAL - /var/tmp/mysql is not accessible: No such
file or directory
May 31 22:46:45 server nrpe[31037]: Return Code: 2, Output: DISK
CRITICAL - /var/tmp/mysql is not accessible: No such file or directory

I think the problem is related to this "private" mount in
nagios-nrpe-server (extract from /proc/xx/mountinfo):
121 113 8:5
/tmp/systemd-private-b35c254c031041979d3126e02a0c5c51-nagios-nrpe-server.service-MbLbk1/tmp
/var/tmp rw,relatime shared:66 master:28 - ext4 /dev/sda5 rw,data=ordered

Best Regards,
-- 
*Emmanuel DECAEN*



More information about the Pkg-nagios-devel mailing list