NetSNMP::Sendmail - NetSNMP plugin for Sendmail statistics
perl use NetSNMP::Sendmail qw (:config bindir /usr/bin/sm.bin);
A perl plugin for net-snmp that provides access to Sendmail statistics information obtained by mailq and mailstats.
In most cases adding
perl use NetSNMP::Sendmail;
to snmpd.conf(5) is enough to get the plugin working. You may however need to tune it. For example, Debian-based distributions override default Sendmail binaries with homemade scripts that have somewhat different output format, which can confuse this module. The binaries are then located in the /usr/lib/sm.bin directory. To have the plugin use the right binaries, load it as follows:
perl use NetSNMP::Sendmail qw(:config bindir /usr/lib/sm.bin);
Another way to do so would be to export the Configure method and call it right after requiring the module:
perl use NetSNMP::Sendmail qw(Configure);
perl NetSNMP::Sendmail::Configure(bindir => '/usr/lib/sm.bin');
In general, configuration options and corresponding values are either passed as a hash to the Configure function, or passed with the use statement following the :config marker. The following options are defined:
Directory where to look for mailq and mailstats. It is unset by default, which means that both binaries will be looked up using the PATH environment variable, unless they are set to absolute pathname using mailq and mailstats keywords.
Absolute name of the Sendmail configuaration file. Defaults to /etc/mail/sendmail.cf.
Name of the mailstats binary. Default is mailstats.
Name of the mailq binary. Default is mailq.
Time in seconds during which the result of the recent invocation of mailstats(8) is cached. Default is 10.
Time in seconds during which the result of the recent invocation of mailq(1) is cached. Default is 10.
The MIB is defined in file SENDMAIL-STATS.txt, which is distributed along with this module. The following OIDs are defined:
Total number of messages in the queue.
This OID provides a conceptual table of Sendmail queue groups. Each row has the following elements (N stands for the row index):
Name of the queue group.
Number of messages in that queue group.
This OID provides a conceptual table of mailers with the corresponding statistics. Each row has the following elements (N stands for the row index):
Name of the mailer, as set in its definition in sendmail.cf.
Number of outgoing messages sent using this mailer.
Number of kilobytes in outgoing messages sent using this mailer.
Number of messages received using this mailer.
Number of kilobytes in messages received using this mailer.
Number of messages rejected by this mailer.
Number of messages discarded by this mailer.
Number of messages put in quarantine by this mailer.
Total number of outgoing messages.
Total number of outgoing kilobytes.
Total number of incoming messages.
Total number of incoming kilobytes.
Total number of rejected messages.
Total number of discarded messages.
Total number of messages put in quarantine.
Number of messages sent over TCP connections.
Number of messages received over TCP connections.
Number of messages that arrived over TCP connections and were rejected.
snmpd.conf(5), snmpd(8), mailq(1), mailstats(8).
GPLv3+: GNU GPL version 3 or later, see <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Sergey Poznyakoff <email@example.com>.
To install NetSNMP::Sendmail, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.