defining a service with parameters leads to errors is service is remote

Bug #1027823 reported by Thomas Schweikle
8
This bug affects 1 person
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{
        hostgroup_name current-load16
        service_description Current Load
        check_command check_nrpe!check_load!40.0 32.0 28.0 48.0 40.0 36.0
        use generic-service
        notification_interval 0 ; set > 0 if you want to be renotified
        }

Then a hostgroup:
define hostgroup {
        hostgroup_name current-load16
        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,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15

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/nagios/plugins/check_load -w ',,' -c ',,'
Jul 23 10:44:15 vh02 nrpe[24461]: Command completed with return code 3 and output: Warning threshold must be float or float triplet!#012#012Usage:#012check_load [-r] -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15
Jul 23 10:44:15 vh02 nrpe[24461]: Return Code: 3, Output: Warning threshold must be float or float triplet!#012#012Usage:#012check_load [-r] -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15

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=/var/run/nagios/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
command_timeout=60
connection_timeout=300
include=/etc/nagios/nrpe_local.cfg
include_dir=/etc/nagios/nrpe.d/

debug=2
dont_blame_nrpe=1
server_address=192.168.180.5
allowed_hosts=127.0.0.1,192.168.180.40,192.168.180.44,192.168.180.45

command[check_all_disks]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -e
command[check_apt_dist]=/usr/lib/nagios/plugins/check_apt -d
command[check_apt]=/usr/lib/nagios/plugins/check_apt
command[check_dig]=/usr/lib/nagios/plugins/check_dig -H $ARG1$ -l $ARG2$
command[check_drbd]=/usr/lib/nagios/plugins/check_drbd -d $ARG1$
command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_load]=/usr/lib/nagios/plugins/check_load -w '$ARG1$,$ARG2$,$ARG3$' -c '$ARG4$,$ARG5$,$ARG6$'
command[check_md_raid]=/usr/bin/sudo /usr/lib/nagios/plugins/check_md_raid
command[check_megaraid_sas]=/usr/lib/nagios/plugins/check_megaraid_sas
command[check_one_disk]=/usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
command[check_pname]=/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ -C $ARG3$
command[check_ports]=/usr/local/libexec/nagios/check_ports -a
command[check_pparm]=/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ -C $ARG3$ -a $ARG4$
command[check_procs]=/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$
command[check_reboot]=/usr/lib/nagios/plugins/check_reboot
command[check_release]=/usr/lib/nagios/plugins/check_release
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$
command[check_update]=/usr/lib64/nagios/plugins/check_updates
command[check_users]=/usr/lib/nagios/plugins/check_users -w $ARG1$ -c $ARG2$
command[check_virt]=/usr/lib/nagios/plugins/check_virt
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z

The relevant lines are:
dont_blame_nrpe=1
command[check_load]=/usr/lib/nagios/plugins/check_load -w '$ARG1$,$ARG2$,$ARG3$' -c '$ARG4$,$ARG5$,$ARG6$'

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
ProcVersionSignature: Ubuntu 3.2.0-26.41-virtual 3.2.19
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)

Revision history for this message
Thomas Schweikle (tps) wrote :
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

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

Changed in nagios3 (Ubuntu):
status: New → Confirmed
status: Confirmed → Fix Released
importance: Undecided → Medium
Changed in nagios3 (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in nagios3 (Ubuntu Precise):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.