defining a service with parameters leads to errors is service is remote
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nagios3 (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Defining a service:
define service{
use generic-service
}
Then a hostgroup:
define hostgroup {
alias Current Load
members vh01
members vh02
}
and the hosts:
define host{
use generic-host
host_name vh01
alias vh01
address vh01
parents zm2
}
define host{
use generic-host
host_name vh02
alias vh02
address vh02
parents vh01
}
gives back an error, instead the awaited result:
Warning threshold must be float or float triplet!
Usage:
check_load [-r] -w WLOAD1,
Digging further, activating debug on the client, leads to:
Jul 23 10:44:15 vh02 nrpe[24461]: Host is asking for command 'check_load' to be run...
Jul 23 10:44:15 vh02 nrpe[24461]: Running command: /usr/lib/
Jul 23 10:44:15 vh02 nrpe[24461]: Command completed with return code 3 and output: Warning threshold must be float or float triplet!
Jul 23 10:44:15 vh02 nrpe[24461]: Return Code: 3, Output: Warning threshold must be float or float triplet!
The parameters given are empty on the client! The nrpe-service definitions are:
log_facility=daemon (BTW: ignored. Fixed upstream, but Ubuntu remains at an old unfixed version)
pid_file=
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
command_timeout=60
connection_
include=
include_
debug=2
dont_blame_nrpe=1
server_
allowed_
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
command[
The relevant lines are:
dont_blame_nrpe=1
command[
the first allows for parameters, the second is the service definition. Looks all OK for me (and others). This problem seems fixed in a later version of nagios, but since Ubuntu is keeping version 3.2.3 ...
Just click on the link "Check for updates" on the nagios home-page:
Your installation of Nagios Core 3.2.3 is outdated and should be upgraded. The latest version of Nagios Core is 3.4.1 was released on 2012-05-14.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: nagios3 3.2.3-3ubuntu1
ProcVersionSign
Uname: Linux 3.2.0-26-virtual x86_64
ApportVersion: 2.0.1-0ubuntu11
Architecture: amd64
Date: Mon Jul 23 10:37:38 2012
InstallationMedia: Ubuntu-Server 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.2)
ProcEnviron:
TERM=screen-bce
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: nagios3
UpgradeStatus: Upgraded to precise on 2012-04-13 (100 days ago)
Hi Thomas, thanks for the excellent bug report!
I verified that this works fine in Nagios 3.4 from quantal, but is broken in the Nagios from precise.
Its conceivable that the fix can be backported. The problem is that the command is being called with everything from the ! to the eol as one argument, so
exec('check_ nrpe',' -c','check_ load',' -a','40. 0 32.0 28.0 48.0 40.0 36.0')
In 3.4 it gets called as
exec('check_ nrpe',' -c','check_ load',' -a','40. 0','32. 0','28. 0','48. 0','40. 0,'36.0' )