A while ago there was a patch for Net-SNMP 5.5 which introduced a new option realStorageUnits
for the configuration file.
From the Redhat Bugreport #748410:
To address this issue [negative hrStorageSite values], this update adds a new option to the
/etc/snmp/snmpd.conf configuration file, realStorageUnits. By changing
the value of this option to 0, users can now enable recalculating all
values in hrStorageTable to ensure that the multiplication of
hrStorageSize and hrStorageAllocationUnits always produces an accurate
device size.
(text in [brackets] is mine)
So adding the configuration directive realStorageUnits 0
to your snmpd.conf might be solving your problem.
However, the values will not be correct up to the very last megabyte; ymmv.
I can't tell if this patch was included in your binary distribution of Net-SNMP, but it would be great if you could report the results and what binary you are using. Also, I didn't test it for the lack of adequate hardware right now.
You can configure snmptrapd
to handle traps with a script; this is the traphandle
directive.
I believe the configuration file is /etc/snmp/snmptrapd.conf
.
For example, you can use:
traphandle IBM-TS3500-MIBv1::ibm3584MIBObjectsTD.0 /usr/local/bin/myscript.pl
Or, to parse everything, you can use:
traphandle default /usr/local/bin/myscript.pl
The contents of the trap is passed to the script in STDIN
so your script will need to read from there.
You don't mention your preferred language for scripting this so I won't go into too much detail; however, the following library exists for Perl: SNMP::Trapinfo
You could do something like this:
use strict;
use SNMP::Trapinfo;
my $trap = SNMP::Trapinfo->new(*STDIN, {hide_passwords => 1});
# parse trap here
my $subject = "Got trap from $trap->hostname";
open EMAIL, "|-", "/usr/bin/Mail", "-s", $subject, "me@mydomain.com";
print EMAIL "My Email Body for SNMP Trap";
close EMAIL;
Additionally, it doesn't look like your traps are being fully translated in /var/log/messages
. I can't remember which variables you need to set to translate the traps with custom MIBs but you should be able to drop your MIBs in /usr/local/share/snmp/mibs (creating that directory if it doesn't exist).
Best Answer
Windows does not come with a default SNMP client, so you would have to install software. I recommend the
Net-SNMP
suite.http://www.net-snmp.org/