PMACCT-SNMP
NAMESYNOPSIS
DESCRIPTION
CONFIGURATION FILES
INSTALLATION
MIB
CACTI INTEGRATION
SECURITY
REFERENCES
COPYRIGHT AND LICENSE
NAME
|
pmacct−snmp |
SYNOPSIS
|
pmacct-snmp pmacct−snmp.conf |
DESCRIPTION
|
pmacct-snmp is an extension for the Net-SNMP agent and the pmacct utility. It allow to access per-host statistics over SNMP . |
CONFIGURATION FILES
|
pmacct-snmp works for pmacct configurations where data is kept in memory and not written to a database. Please look in the pmacct directory of the source archive for a sample pmacct configuration. Once you have pmacct running, you can start configuring pmacct-snmp. The pmacct−snmp.conf configuration file defines the location of the pipe files used by pmacct as well as the hosts whose statistics you would like to publish using SNMP . The file is in key: value format and allows the following keys: |
|
pmacct: "/usr/bin/pmacct" |
|
Full path to the pmacct executable. |
|
inbound: "/var/run/pmacct−in.pipe" =item outbound: "/var/run/pmacct−out.pipe" |
|
Location of the two pipe files used for inbound and outbound traffic. |
|
hosts: "network/mask" |
|
Defines the networks with the hosts to monitor, in CIDR notation. For every host in these networks, a "PmacctSnmpIpEntry" will be published in the MIB . Be aware that for every network and host defined here, pmacct-snmp allocates memory. You can have multiple "hosts" lines in your configuration file. |
|
Since this extension is a persistent script, changes to the configuration file require a restart of snmpd. |
INSTALLATION
|
After installing the pmacct-snmp script and adapting the configuration file, it is best to test it manually. This can be done with the following dialog: PING The script should return " PONG ". get .1.3.6.1.4.1.21695.1.4.1 The script should return three lines: the OID , "integer", and the number of configured addresses. Quit the dialog using CTRL−D . If everything works, insert the following line into your Net−SNMP’s snmpd.conf configuration file: pass_persist .1.3.6.1.4.1.21695.1.4 /usr/sbin/pmacct−snmp /etc/pmacct−snmp.conf Net-SNMP will need to be restarted after this change. You should now be able to get the statistics using snmpwalk, for example: $ snmpwalk −v 2c −c community .1.3.6.1.4.1.21695.1.4 This should give you all the the statistics. |
MIB
|
The script returns the following variables: .1.3.6.1.4.1.21695.1.4.1: number of configured pools .1.3.6.1.4.1.21695.1.4.2.1.<ip>: <ip> .1.3.6.1.4.1.21695.1.4.2.2.<ip>: InOctets .1.3.6.1.4.1.21695.1.4.2.3.<ip>: OutOctets .1.3.6.1.4.1.21695.1.4.2.4.<ip>: InPackets .1.3.6.1.4.1.21695.1.4.2.5.<ip>: OutPackets For a complete MIB file see the mibs directory in the source archive. |
CACTI INTEGRATION
|
In order to pmacct-snmp with the network graphing tool, you need the files in the cacti directory of the source distribution. |
|
• |
Copy pmacct−object.xml to cacti−path/resource/snmp_queries/ |
||
|
• |
Import the data query template pmacct_data_query.xml into Cacti |
||
|
• |
Import the host template pmacct_host.xml into Cacti. |
||
|
• |
You can now create new devices of type pmacct Host. When you click on "Create Graphs for this Host", you will see all the IP addresses pmacct-snmp is configured for. |
SECURITY
|
It is assumed that users of this script know how to properly secure their snmpd. Please read the corresponding man pages on more information about this. |
REFERENCES
|
<http://www.pmacct.org> |
|
<http://www.cacti.net> |
|
<http://net−snmp.sourceforge.net/> |
COPYRIGHT AND LICENSE
|
Copyright (C) 2007 Oliver Hitz This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY ; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place − Suite 330, Boston, MA 02111−1307, USA . |