System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

SnmpHpux returns a bad idle cpu value

 
olohoyo
Occasional Collector

SnmpHpux returns a bad idle cpu value

Hello everybody,

I encounter a strange problem while trying to monitor my HP-UX 11.23/Itanium CPU activity by means of SNMP requests. On one of my 5 servers, the idle cpu value is false, showing a never less than 75% of idleness even if all the 4 CPUs are 100% idle.

I use a 3rd party software to retrieve the idle cpu value (OID = SNMPv2-SMI::enterprises.11.2.3.1.1.15.0), but I can reproduce the case with just a small bash script:

 

----- test_snmp.sh---------

#!/usr/local/bin/bash

# get cpu idle and uptime values via SNMP
a=($( snmpget -v 2c -c public -OvetQ localhost .1.3.6.1.4.1.11.2.3.1.1.15.0  .1.3.6.1.2.1.1.3.0 ))
# ask vmstat to show it's idea of cpu idle value (it'll take a second to execute, which is more than sufficient for
# next snmpget)
echo "vmstat cpu id value:"
vmstat 1 2 | awk '(NR==4){print $NF}'
# get new SNMP values:
b=($( snmpget -v 2c -c public -OvetQ localhost .1.3.6.1.4.1.11.2.3.1.1.15.0  .1.3.6.1.2.1.1.3.0 ))
echo "SNMP cpu idle value:"
# use dc to make floating point calculation:
dc << EOF
2 k
${b[0]} ${a[0]} -
${b[1]} ${a[1]} -
/
100 *
p q
EOF

 (I'm using vmstat here because it's easier to parse it's output, but "top" would give the same results)

 

And now some executions of my magic script:

 

scpqudb5 ( root ] # ./test_snmp.sh
vmstat cpu id value:
93
SNMP cpu idle value:
66.00
scpqudb5 ( root ] # ./test_snmp.sh
vmstat cpu id value:
95
SNMP cpu idle value:
70.00
scpqudb5 ( root ] # ./test_snmp.sh
vmstat cpu id value:
91
SNMP cpu idle value:
65.00
scpqudb5 ( root ] # ./test_snmp.sh
vmstat cpu id value:
93
SNMP cpu idle value:
19.00

Of course, the same script on the other servers gives better results:

scpqudb2 ( root ] # ./test_snmp.sh
vmstat cpu id value:
99
SNMP cpu idle value:
97.00
scpqudb2 ( root ] # ./test_snmp.sh
vmstat cpu id value:
94
SNMP cpu idle value:
92.00
scpqudb2 ( root ] # ./test_snmp.sh
vmstat cpu id value:
97
SNMP cpu idle value:
94.00

 

Does anybody have an idea of what I should check to solve this strange and annoying problem?

 

Best regards