Bug#863797: Bug#863797: monitoring-plugins-basic: unable to use check_disk inside /var/tmp

2017-06-01 Thread Bas Couwenberg

On 2017-06-01 10:11, Emmanuel DECAEN wrote:

Le 01/06/2017 à 07:21, Sebastiaan Couwenberg a écrit :

notfound 863797 nagios-nrpe/3.0.1-3
thanks

On 05/31/2017 11:05 PM, Emmanuel DECAEN wrote:
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

The systemd configuration uses PrivateTmp=true, you can override it by
adding a snippet:

 /etc/systemd/system/nagios-nrpe-server.service.d/local.conf

With the following content:

 [Service]
 PrivateTmp=false

See systemd.exec(5) for details about PrivateTmp.


Thanks for the details.



You have a non-standard setup, hence you need to customize the
configuration. This is not a bug in nagios-nrpe, so I'm closing this 
issue.


I disagree. Having a configuration using standard check_disk on any
directory can't be considered as "a non-standard setup" (and especially
when it was working correctly in Debian 8)


Your check_disk command is not standard, on Debian systems 
/var/tmp/mysql is not a standard directory.


/var/tmp and its subdirectories are either part of the / slice or a 
separate /var slice.



Maybe, I'm missing something but there was no "PrivateTmp=true" in
Debian 8 nagios-nrpe-server.
From what I see, using "PrivateTmp=true" in nagios-nrpe-server is a
*change in behavior from Debian 8 to Debian 9*.


NRPE 2.15 in jessie didn't support systemd, NRPE 3.0 in stretch does.

It is a change in behavior, but not a bug.


I think, you can't indicate "not found" on this bug report as it can be
easily reproduced, with a standard check_disk configuration.


It's not a bug, so I removed the affected version.


Don't you think the package upgrade should warn user about this change
when migrating from Debian 8 to Debian 9 ?


No. Standard setups don't have a separate /var/tmp/mysql partition, and 
will have /var/tmp as part of the root file system or separate /var. 
check_disk via NRPE works as expected on those systems.


You have a non-standard setup where you explicitly want to monitor a 
non-standard subdirectory of /var/tmp and so you need to customize your 
monitoring to work with your non-standard setup.


On one of my systems I have a separate /tmp and /var and there 
check_disk works just fine via NRPE 3.x with PrivateTmp=true.


Kind Regards,

Bas



Bug#863797: Bug#863797: monitoring-plugins-basic: unable to use check_disk inside /var/tmp

2017-06-01 Thread Emmanuel DECAEN
Le 01/06/2017 à 07:21, Sebastiaan Couwenberg a écrit :
> notfound 863797 nagios-nrpe/3.0.1-3
> thanks
>
> On 05/31/2017 11:05 PM, Emmanuel DECAEN wrote:
>>> 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
> The systemd configuration uses PrivateTmp=true, you can override it by
> adding a snippet:
>
>  /etc/systemd/system/nagios-nrpe-server.service.d/local.conf
>
> With the following content:
>
>  [Service]
>  PrivateTmp=false
>
> See systemd.exec(5) for details about PrivateTmp.

Thanks for the details.

>
> You have a non-standard setup, hence you need to customize the
> configuration. This is not a bug in nagios-nrpe, so I'm closing this issue.

I disagree. Having a configuration using standard check_disk on any
directory can't be considered as "a non-standard setup" (and especially
when it was working correctly in Debian 8)

Maybe, I'm missing something but there was no "PrivateTmp=true" in
Debian 8 nagios-nrpe-server.
>From what I see, using "PrivateTmp=true" in nagios-nrpe-server is a
*change in behavior from Debian 8 to Debian 9*.

I think, you can't indicate "not found" on this bug report as it can be
easily reproduced, with a standard check_disk configuration.
Don't you think the package upgrade should warn user about this change
when migrating from Debian 8 to Debian 9 ?

Regards,
-- 
*Emmanuel DECAEN*



Bug#863797: Bug#863797: monitoring-plugins-basic: unable to use check_disk inside /var/tmp

2017-05-31 Thread Emmanuel DECAEN
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@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@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*



Bug#863797: Bug#863797: monitoring-plugins-basic: unable to use check_disk inside /var/tmp

2017-05-31 Thread Sebastiaan Couwenberg
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@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?

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

Kind Regards,

Bas

-- 
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1



Bug#863797: Bug#863797: monitoring-plugins-basic: unable to use check_disk inside /var/tmp

2017-05-31 Thread Emmanuel DECAEN
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@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

>
> 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

Best Regards

-- 
*Emmanuel DECAEN*



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

2017-05-31 Thread Bas Couwenberg

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.


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).


Kind Regards,

Bas