Page 1 of 2

HP-UX CPU statistics is not working

Posted: Fri Jun 02, 2017 5:45 am
by sgoffar
Hi Team,

We have a HP-UX box for which CPU statistics is not showing data when we are running the script as a service.

However when we are running it manually on server it's working fine.
Server output:
/opt/nrpe/libexec/check_cpu.sh
CPU STATISTICS OK : user=0% system=0% iowait=0% idle=100% nice=0.00% steal=0.00% | CpuUser=0;CpuSystem=0;CpuIowait=0;CpuIdle=100;CpuNice=00.0;CpuSteal=00.0;70,40,30;90,60,40
Nagios error:
/usr/local/nagios/libexec/check_nrpe -H 172.24.x.x-t 60 -c check_cpu -n -a '-w 70,40,30 -c 90,40,30'
ERROR : Bad count parameter in Warning Threshold

Plugin Details:

# CPU Utilization Statistics plugin for Nagios
#
# Written by : Steve Bosek
# Patched by : Bas van der Doorn
# Release : 2.3
# Creation date : 8 September 2007
# Revision date : 11 December 2008
# Package : DTB Nagios Plugin
# Description : Nagios plugin (script) to check cpu utilization statistics.
# This script has been designed and written on Unix plateform (Lin
ux, Aix, Solaris),
# requiring iostat as external program. The locations of these can
easily
# be changed by editing the variables $IOSTAT at the top of the sc
ript.
# The script is used to query 6 of the key cpu statistics (user,sy
stem,iowait,steal,nice,idle)
# at the same time.
#
# USAGE : ./check_cpu_stats.sh Regards,
Sk Abdul Goffar

Re: HP-UX CPU statistics is not working

Posted: Fri Jun 02, 2017 9:15 am
by avandemore
We don't support custom plugins but here are some troubleshooting steps.

Run the plugin as the nrpe user, usually this is the user nagios. You can find it's definition in nrpe.cfg.
Run the plugin locally through nrpe, eg check_nrpe -H 127.0.0.1
Use the latest NRPE daemon and run in debug mode:
https://github.com/NagiosEnterprises/nrpe

Re: HP-UX CPU statistics is not working

Posted: Wed Jun 21, 2017 1:26 pm
by tmcdonald
Just checking in since we have not heard from you in a while. Did @avandemore's post clear things up or has the issue otherwise been resolved?

Re: HP-UX CPU statistics is not working

Posted: Wed Jun 28, 2017 7:56 am
by sgoffar
Hi ,

I believe this is nagios plugin. Also the plugin is working locally not working when we are configuring as a service.

However it's suddenly start throwing the error.

root@snguxap7 # su nagios
root@snguxap7 # id
uid=133(nagios) gid=122(nagios)
root@snguxap7 # pwd
/opt/nrpe/libexec
root@snguxap7 # ./check_cpu.sh
CPU STATISTICS OK : user=0% system=0% iowait=1% idle=99% nice=0.00% steal=0.00% | CpuUser=0;CpuSystem=0;CpuIowait=1;CpuIdle=99;CpuNice=00.0;CpuSteal=00.0;70,40,30;90,60,40
root@snguxap7 # exit
root@snguxap7 # id
uid=0(root) gid=3(sys) groups=0(root),1(other),2(bin),4(adm),5(daemon),6(mail),7(lp),20(users)
root@snguxap7 # ./check_cpu.sh
CPU STATISTICS OK : user=0% system=0% iowait=1% idle=98% nice=0.00% steal=0.00% | CpuUser=0;CpuSystem=0;CpuIowait=1;CpuIdle=98;CpuNice=00.0;CpuSteal=00.0;70,40,30;90,60,40

Re: HP-UX CPU statistics is not working

Posted: Wed Jun 28, 2017 1:07 pm
by tgriep
The error
ERROR : Bad count parameter in Warning Threshold
It is caused by too many variables in the warning and critical threshold settings when you ran the check using the check_nrpe plugin.

Try this example below and see it it works for you.

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 172.24.x.x-t 60 -c check_cpu -n -a '-w 70 -c 90'

Re: HP-UX CPU statistics is not working

Posted: Thu Jun 29, 2017 3:27 am
by sgoffar
We are getting same error. Please find below the data:

[root@dfwlxngxi01 ~]# /usr/local/nagios/libexec/check_nrpe -H snguxap7.X.X. -t 60 -c check_cpu -n -a '-w 70 -c 90'
ERROR : Bad count parameter in Warning Threshold
[root@dfwlxngxi01 ~]# /usr/local/nagios/libexec/check_nrpe -H snguxap7.X.X -t 60 -c check_cpu -n
ERROR : Bad count parameter in Warning Threshold
[root@dfwlxngxi01 ~]# /usr/local/nagios/libexec/check_nrpe -H 172.24.X.X -t 60 -c check_cpu -n
ERROR : Bad count parameter in Warning Threshold
[root@dfwlxngxi01 ~]# /usr/local/nagios/libexec/check_nrpe -H 172.24.X.X -t 60 -c check_cpu -n -a '-w 70 -c 90'
ERROR : Bad count parameter in Warning Threshold

Re: HP-UX CPU statistics is not working

Posted: Thu Jun 29, 2017 9:34 am
by tgriep
Can you post the nrpe.cfg file from the HP-UX server so we can see view the settings?

Re: HP-UX CPU statistics is not working

Posted: Fri Jun 30, 2017 6:02 am
by sgoffar
I have restarted the NRPE Agent and it's started working fine.

Re: HP-UX CPU statistics is not working

Posted: Fri Jun 30, 2017 9:24 am
by tmcdonald
Did you have any further (related) questions or are we okay to close this thread?

Re: HP-UX CPU statistics is not working

Posted: Mon Jul 03, 2017 2:46 am
by sgoffar
Yes..U can close the thread.