SNMP Perl Plugin use custom MIB
Posted: Wed Oct 25, 2017 1:51 pm
I'm building a custom perl plugin for SNMP that heavily depends on the MIB that I uploaded. How do I build the plugin to use this specific MIB?
If that cannot be done, how can I convert ASCII ($PoolName) entered variable to decimal value to make that an OID within perl? (Kinda outside a nagios related question but figured I'd ask here as well)
If I can use the MIB this would be how I pool
Code: Select all
my ($session, $error) = Net::SNMP->session(
-hostname => $Hostname,
-community => $Community,
#-miblist => 'F5-BIGIP-LOCAL-MIB',
#Above did not work
-port => 161,
-version => 'snmpv2c',
-nonblocking => 0
);
If I can use the MIB this would be how I pool
Code: Select all
my($PoolName) = $ARGV[1];
my($OIDPoolStatus) = "ltmPoolStatusAvailState.\\\"$PoolName\\\"";
my $polled_oids_1 = $session->get_request(-varbindlist => [$$OIDPoolStatus]);