MRTG
First you need to install snmpd from portsThen install MRTG from ports
cd /usr/ports/net-mgmt/mrtg make install
Make web server dirs ready
mkdir /usr/local/www/apache22/data/stats chown mrtg /usr/local/www/apache22/data/stats
Check your interface index
snmpwalk -v 2c -c read2user localhost IP-MIB::ipAdEntIfIndex IP-MIB::ipAdEntIfIndex.78.47.207.147 = INTEGER: 1 IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 2
(See the 1 after the IP 78.47.207.147. This is what we want to use in the config file next)
Make a simple config file (/usr/local/etc/mrtg/mrtg.cfg) to begin with
WorkDir: /usr/local/www/apache22/data/stats Target[confighell]: 1:read2user@localhost MaxBytes[confighell]: 10240000 Title[confighell]: Traffic on Confighell PageTop[confighell]: <H1>Stats for Confighell</H1>
(See the link between Target[confighell]: 1:* and the index we just found before)
Start MRTG daemon
echo mrtg_daemon_enable="YES" >> /etc/rc.conf /usr/local/etc/rc.d/mrtg_daemon start
See also
Cacti?
- + : A leading plus sign indicates that this word must be present in every object returned.
- - : A leading minus sign indicates that this word must not be present in any row returned.
- By default (when neither plus nor minus is specified) the word is optional, but the object that contain it will be rated higher.
- < > : These two operators are used to change a word's contribution to the relevance value that is assigned to a row.
- ( ) : Parentheses are used to group words into subexpressions.
- ~ : A leading tilde acts as a negation operator, causing the word's contribution to the object relevance to be negative. It's useful for marking noise words. An object that contains such a word will be rated lower than others, but will not be excluded altogether, as it would be with the - operator.
- * : An asterisk is the truncation operator. Unlike the other operators, it should be appended to the word, not prepended.
- " : The phrase, that is enclosed in double quotes ", matches only objects that contain this phrase literally, as it was typed.
