CLDU
Aug 17, 2007Nimbostratus
cpu 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
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
!/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;
tmmcpu.pl myHost mySNMPstring
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
I don't think this is an officially supported command, but it provides real-time CPU stats for TMM.
Aaron
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