We have looked for how to monitor user sessions on our Contivity Switches for some time and couldn’t find an easy way to do so. Ultimately I wrote a small script to collect the information and return it for graphing in Cacti. To get this setup, use the script below along with the instructions on the Cacti site that you can find here.
> nortel_users.php
#!/usr/bin/php -q
<?php
$no_http_headers = true;
$hostname = $argv[1];
$snmp_community = $argv[2];
$snmp_version = $argv[3];
# This is a small utility to count the number of user sessions on a nortel
# OID to use to get list of active users
$oid = ".1.3.6.1.2.1.31.1.1.1.1";
$resultarray = array();
if($argv[1] != '' ){
$resultarray = snmpwalk($hostname,$snmp_community, $oid);
$numb_users = ((sizeof($resultarray))-3);
print "users:$numb_users\\n";
}
# Thats all folks
?>