Forum Discussion
CLDU
Nimbostratus
Aug 17, 2007cpu monitoring
Hello,
I try to monitor tmm cpu usage on a 9.2.4 bigip
a top command says cpu used at 100%
how can i get the real tmm cpu used?
thanks for your help
Clement
6 Replies
- JRahm
Admin
Here's a stdout version of a perl script I use to graph TMM utilization in cacti:!/usr/bin/perl Usage: tmm-cpu.pl use Net::SNMP qw(:snmp); my $host = $ARGV[0]; my $snmp_comm = $ARGV[1]; chomp $host; chomp $snmp_comm; my $oid_tmm_tc = '.1.3.6.1.4.1.3375.2.1.1.2.1.41.0'; my $oid_tmm_ic = '.1.3.6.1.4.1.3375.2.1.1.2.1.42.0'; my $oid_tmm_sc = '.1.3.6.1.4.1.3375.2.1.1.2.1.43.0'; my ($session, $error) = Net::SNMP->session( -hostname => $host, -community => $snmp_comm, -port => 161, -version => 'snmpv2c', -nonblocking => 0 ); if (!defined $session) { print "Received no SNMP response from $host\n"; print STDERR "Error: $error\n"; exit -1; } poll CPU oids my $polled_oids = $session->get_request( -varbindlist => [$oid_tmm_tc, $oid_tmm_ic, $oid_tmm_sc] ); calculate CPU Utilization my $tmm_cpu = ( ( $polled_oids->{$oid_tmm_tc} - ( $polled_oids->{$oid_tmm_ic} + $polled_oids->{$oid_tmm_sc} ) ) / $polled_oids->{$oid_tmm_tc} ) * 100 ; Round to integer $tmm_cpu = int($tmm_cpu + .5); print CPU Utilization to stdout for cli validation print $tmm_cpu; - JRahm
Admin
..hmm, didn't like my lt / gt brackets on the usage line, edited the post for clarity - JRahm
Admin
Actually, doesn't look like the edit link exists on this forum. Usage is:
tmmcpu.pl myHost mySNMPstring - Deb_Allen_18Historic F5 AccountThanks, citizen_elah.
Looking into it now.
But if you wouldn't mind posting to the codeshare instead, I just added a new section to the AdvDesign & Config codeshare collector page for Management Scripts like this one & the one hoolio posted yesterday. If you flag them with the following keyword line::SAMPLE_CATEGORIES: ,MgmtScript,
it will show up there.
thanks!
/deb - hoolio
Cirrostratus
A much less robust option than Citizen's perl script for SNMP polling (but closer to top functionality) would be to run tmstat from the CLI. The CPU stats in the upper left are accurate for CPU1, the TMM CPU.
I don't think this is an officially supported command, but it provides real-time CPU stats for TMM.
Aaron - CLDU
Nimbostratus
Hello,
Thanks for your perl script but I always get 0 on TmIdle cycle.
snmpwalk -c xxxxxx -v 2c A.B.C.D .1.3.6.1.4.1.3375.2.1.1.2.1.43
SNMPv2-SMI::enterprises.3375.2.1.1.2.1.43.0 = Counter64: 0
However on tmstat my cpu utilizations is about 20%
regards,
Clement
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects