Operating System - HP-UX
1849291 Members
6582 Online
104042 Solutions
New Discussion

Re: Does HP-UX default snmp provide CPU utilization?

 
ericfjchen
Regular Advisor

Does HP-UX default snmp provide CPU utilization?

Does HP-UX default snmp provide CPU utilization? If yes, how to get the OID of CPU utilization in HP-UX? If no, should we install net-snmp in HP-UX? How to do it?

Thanks

Eric
4 REPLIES 4
Geoff Wild
Honored Contributor

Re: Does HP-UX default snmp provide CPU utilization?

By default - yes!

If you want to see "live" graphs, have a look at MRTG:

http://www.ee.ethz.ch/~oetiker/webtools/mrtg


I use it to monitor CPU and Memory of my servers, but you can also do uptime as well...

Here's how I monitor HP-UX with SNMP:

##############################################################
########


Target[sha1.internaldomain.netcpup]:.1.3.6.1.4.1.11.2.3.1.1.15.0&.1.3.6.1.4.1.11.2.3.1.
1.13.0:public@sha1.p
cacorp.net + .1.3.6.1.4.1.11.2.3.1.1.16.0&.1.3.6.1.4.1.11.2.3.1.1.14.0:public@sha1.internaldo
main.net
Title[sha1.internaldomain.netcpup]: CPU Load on sha1.internaldomain.net
MaxBytes[sha1.internaldomain.netcpup]
: 100
Ylegend[sha1.internaldomain.netcpup]
: CPU Load
ShortLegend[sha1.internaldomain.netcpup]
: %
PageTop[sha1.internaldomain.netcpup]
:

CPU Load on sha1.internaldomain.net


Options[sha1.internaldomain.netcpup]
: integer, growright, nopercent
WithPeak[sha1.internaldomain.netcpup]
: wmy
LegendO[sha1.internaldomain.netcpup]
: User/System:  
LegendI[sha1.internaldomain.netcpup]
: Idle/Nice:  
Legend1[sha1.internaldomain.netcpup]
: Idle/Nice CPU Time
Legend2[sha1.internaldomain.netcpup]
: User/System CPU Time
Legend3[sha1.internaldomain.netcpup]
: Maximal Idle/Nice CPU Time
Legend4[sha1.internaldomain.netcpup]
: Maximal User/System CPU Time

##############################################################
########

Target[sha1.internaldomain.netmem]: .1.3.6.1.4.1.11.2.3.1.1.7.0&.1.3.6.1.4.1.11.2.3.1.1.8.0:public@sha1.pca
corp.net
Title[sha1.internaldomain.netmem]
: Memory on sha1.internaldomain.net
MaxBytes[sha1.internaldomain.netmem]
: 100000000
Ylegend[sha1.internaldomain.netmem]
: Memory Usage
ShortLegend[sha1.internaldomain.netmem]
:  
PageTop[sha1.internaldomain.netmem]
:

Memory on sha1.internaldomain.net


Options[sha1.internaldomain.netmem]
: integer, gauge, growright, nopercent
kilo[sha1.internaldomain.netmem]
: 1024
WithPeak[sha1.internaldomain.netmem]
: wmy
LegendO[sha1.internaldomain.netmem]
: Total:  
LegendI[sha1.internaldomain.netmem]
: Free:  
Legend1[sha1.internaldomain.netmem]
: Free System Memory
Legend2[sha1.internaldomain.netmem]
: Total Available System Memory
Legend3[sha1.internaldomain.netmem]
: Maximal Available System Memory
Legend4[sha1.internaldomain.netmem]
: Maximal Free System Memory


###############################################################
#######


Sun and others - you need to script (as snmp is limited).


# dns stats for mrtg
3,8,13,18,23,28,33,38,43,48,53,5
8 * * * * /usr/local/bin/mrtg-dns-stats >/dev/null 2>&1



#!/bin/sh

# generate mrtg file for dns stats
/usr/local/sbin/rndc stats
SERVER=`uname -n`
MRTG=/tmp/$SERVER.named.stats.mrtg
STATS=/etc/namedb/named.stats
#ge
t success
tail -7 $STATS | head -1 |awk '{print $2}'>$MRTG
tail -2 $STATS | head -1 |awk '{print $2}'>>$MRTG
uptime | awk '{print $3,$4,$5}' |sed s/,//g >>$MRTG
echo $SERVER >>$MRTG
#generate mrtg file for cpu
MRTGcpu=/tmp/$SERVER.cpu.stats.mrtg
idle="`/usr/bin/vmsta
t 1 2 | tail -1 | awk '{print $NF}'`"
usersys=`expr 100 - $idle`

echo $idle >$MRTGcpu
echo $usersys >>$MRTGcpu
uptime | awk '{print $3,$4,$5}' |sed s/,//g >>$MRTGcpu
echo $SERVER >>$MRTGcpu

MRTGmem=/tmp/$SERVER.mem.stats.mrtg

/usr/local/bin/mem-swap4mrtg.s
h mem >$MRTGmem


The rcp those files to your web server:

#------------------------------------------

Target[dnsdnsserver]
: `cat /tmp/dnsserver.named.stats.mrtg`
Options[dnsdnsserver]
: nopercent,growright,perhour
Title[dnsdnsserver]
: DNS: Requests per hour on dnsserver
PageTop[dnsdnsserver]:

DNS: Requests per hour on dnsserver


MaxBytes[dnsdnsserver]
: 1000000000
YLegend[dnsdnsserver]: reqs/hour
ShortLegend[dnsdnsserver]: per hour
LegendI[dnsdnsserver]:  Requests:
LegendO[dnsdnsserver]
:  Failures:
Legend1[dnsdnsserver]
: Requests per hour
Legend2[dnsdnsserver]: Failures per hour
PageFoot[dnsdnsserver]:
Note:
;
success is the number of successful queries the server handled.
failures is the number of queries the server received that resulted in
errors other than those covered by nxrrset and nxdomain.



#------------------------------------------

Target[dnsserver.cpu]
: `cat /tmp/dnsserver.cpu.stats.mrtg`
Title[dnsserver.cpu]
: CPU Load on dnsserver.pcacorp.net
MaxBytes[dnsserver.cpu]
: 100
Ylegend[dnsserver.cpu]: CPU Load
ShortLegend[dnsserver.cpu]: %
PageTop[dnsserver.cpu]:

CPU Load on dnsserver


Options[dnsserver.cpu]
: integer, gauge, growright, nopercent
WithPeak[dnsserver.cpu]: wmy
LegendO[dnsserver.cpu]: User/System:  
LegendI[dnsserver.cpu]: Idle/Nice:  
Legend1[dnsserver.cpu]: Idle/Nice CPU Time
Legend2[dnsserver.cpu]: User/System CPU Time
Legend3[dnsserver.cpu]: Maximal Idle/Nice CPU Time
Legend4[dnsserver.cpu]: Maximal User/System CPU Time

Target[dnsserver.mem]: `cat /tmp/dnsserver.mem.stats.mrtg`
Title[dnsserver.mem]
: Memory on dnsserver.pcacorp.net
MaxBytes[dnsserver.mem]
: 1000000000
Ylegend[dnsserver.mem]: Memory Usage
ShortLegend[dnsserver.mem]:  
PageTop[dnsserver.mem]:

Memory on dnsserver


Options[dnsserver.mem]
: integer, gauge, growright, nopercent
kilo[dnsserver.mem]: 1024
WithPeak[dnsserver.mem]: wmy
kMG[dnsserver.mem]: k,M,G
LegendI[dnsserver.mem]: Free: 
LegendO[dnsserver.mem]
: Total: 
Legend1[dnsserver.mem]
: Free System Memory
Legend2[dnsserver.mem]: Total Available System Memory
Legend3[dnsserver.mem]: Maximal Free System Memory
Legend4[dnsserver.mem]: Maximal Available System Memory


To get oids - you need a tool like getif:

http://www.wtcs.org/snmp4tpc/getif.htm

I also had to load some hpux mibs into the getif directory....

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Adisuria Wangsadinata_1
Honored Contributor

Re: Does HP-UX default snmp provide CPU utilization?

Hi,

Check the url below (docID : OV-EN017797) about 'How to measure system sys,idle,nice,user CPU states using SNMP data' :

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&admit=-682735245+1131514961702+28353475&docId=200000079975617

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
Geoff Wild
Honored Contributor

Re: Does HP-UX default snmp provide CPU utilization?

Also see this thread:

http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=964624

Rgds....Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Bill Hassell
Honored Contributor

Re: Does HP-UX default snmp provide CPU utilization?

I would install HP's version of net-SNMP as a fast way to read and navigate through the MIBs. HP has a precomiled version packaged at:

http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXIEXP1111

This is actually a collection of open-source programs ready to install on HP-UX. You can also pick a specific product like net-SNMP.


Bill Hassell, sysadmin