Cacti: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(→Qmail) |
Keine Bearbeitungszusammenfassung |
||
Zeile 2: | Zeile 2: | ||
=Erweiterungen= | =Erweiterungen= | ||
==iptables== | |||
http://forums.cacti.net/about8091.html | |||
<pre> | |||
#!/usr/bin/perl | |||
### | |||
### This is a quick perl script to | |||
### pull bandwidth usage from iptables chains | |||
### | |||
### If you use/optimize this script, please let me know. | |||
### Brian Stanback : brian [at] stanback [dot] net | |||
## | |||
### Example iptables rule for web bandwidth usage: | |||
### > iptables -N WWW | |||
### > iptables -A WWW -j ACCEPT | |||
### > iptables -A INPUT -p tcp -m tcp --dport 80 -j WWW | |||
### > iptables -A OUTPUT -p tcp -m tcp --sport 80 -j WWW | |||
### | |||
### Run "iptables.pl WWW" as root to test, note that you can | |||
### combine more than one protocol into a single chain. | |||
### | |||
### Sudo Configuration (/etc/sudoers) | |||
### > www-data ALL = NOPASSWD: /usr/share/cacti/scripts/iptables.pl | |||
### | |||
### The Input String should be set to "sudo <path_cacti>/scripts/iptables.pl <chain>" | |||
### and you will need to setup an input field so that the <chain> argument can be passed. | |||
### | |||
### The data input type should be set to COUNTER | |||
### | |||
## | |||
## | |||
## modified by: Paul Campbell <forums@campbell-multimedia.co.uk> | |||
## Now returns a seperate entry for each rule. Output for a | |||
## 3 rule chain might now be: | |||
## rule1:123 rule2:456 rule3:789 | |||
# | |||
if ($ARGV[0]) { | |||
$chains = `/sbin/iptables --line-number -xnvL $ARGV[0]`; | |||
@chains = split(/\n/, $chains); | |||
shift(@chains); | |||
shift(@chains); | |||
foreach( @chains ) { | |||
/(\d+)\W+[0-9]+\W+([0-9]+)\W+/; | |||
print " rule$1:$2"; | |||
} | |||
print "\n"; | |||
#$chains[2] =~ /[\W+]?[0-9]+\W+([0-9]+)\W+/; | |||
} else { | |||
print "Usage: $0 Chain\n"; | |||
} | |||
</pre> | |||
==Mysql== | ==Mysql== | ||
http://forums.cacti.net/viewtopic.php?t=6108 | http://forums.cacti.net/viewtopic.php?t=6108 |
Version vom 19. Dezember 2006, 04:10 Uhr
Cacti
Erweiterungen
iptables
http://forums.cacti.net/about8091.html
#!/usr/bin/perl ### ### This is a quick perl script to ### pull bandwidth usage from iptables chains ### ### If you use/optimize this script, please let me know. ### Brian Stanback : brian [at] stanback [dot] net ## ### Example iptables rule for web bandwidth usage: ### > iptables -N WWW ### > iptables -A WWW -j ACCEPT ### > iptables -A INPUT -p tcp -m tcp --dport 80 -j WWW ### > iptables -A OUTPUT -p tcp -m tcp --sport 80 -j WWW ### ### Run "iptables.pl WWW" as root to test, note that you can ### combine more than one protocol into a single chain. ### ### Sudo Configuration (/etc/sudoers) ### > www-data ALL = NOPASSWD: /usr/share/cacti/scripts/iptables.pl ### ### The Input String should be set to "sudo <path_cacti>/scripts/iptables.pl <chain>" ### and you will need to setup an input field so that the <chain> argument can be passed. ### ### The data input type should be set to COUNTER ### ## ## ## modified by: Paul Campbell <forums@campbell-multimedia.co.uk> ## Now returns a seperate entry for each rule. Output for a ## 3 rule chain might now be: ## rule1:123 rule2:456 rule3:789 # if ($ARGV[0]) { $chains = `/sbin/iptables --line-number -xnvL $ARGV[0]`; @chains = split(/\n/, $chains); shift(@chains); shift(@chains); foreach( @chains ) { /(\d+)\W+[0-9]+\W+([0-9]+)\W+/; print " rule$1:$2"; } print "\n"; #$chains[2] =~ /[\W+]?[0-9]+\W+([0-9]+)\W+/; } else { print "Usage: $0 Chain\n"; }
Mysql
http://forums.cacti.net/viewtopic.php?t=6108
Squid
in /etc/snmp/snmpd.conf
proxy -v 1 -c public localhost:3401 .1.3.6.1.4.1.3495.1
und in /etc/squid/squid.conf
acl snmppublic snmp_community public snmp_access allow snmppublic localhost snmp_access deny all snmp_port 3401
http://forums.cacti.net/about4142-0-asc-0.html
Qmail
snmpd erweitern: http://wotsit.thingy.com/haj/cacti/cacti-qmail.html
/etc/snmp/snmpd.conf
... exec .1.3.6.1.4.1.2021.50.1 qmail-message-status /usr/local/bin/qmailmrtg7 s /var/log/qmail exec .1.3.6.1.4.1.2021.50.2 qmail-bytes-transfer /usr/local/bin/qmailmrtg7 b /var/log/qmail exec .1.3.6.1.4.1.2021.50.3 qmail-smtp-concurrency /usr/local/bin/qmailmrtg7 t /var/log/qmail/smtpd exec .1.3.6.1.4.1.2021.50.4 qmail-sessions /usr/local/bin/qmailmrtg7 a /var/log/qmail/smtpd exec .1.3.6.1.4.1.2021.50.5 qmail-queue /usr/local/bin/qmailmrtg7 q /var/qmail/queue exec .1.3.6.1.4.1.2021.50.6 qmail-messages /usr/local/bin/qmailmrtg7 m /var/log/qmail exec .1.3.6.1.4.1.2021.50.7 qmail-concurrency /usr/local/bin/qmailmrtg7 c /var/log/qmail ...
Werte abfragen:
snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
Cacti-Templates: http://forums.cacti.net/about3839.html
OIDs:
Qmail - Messages - Attempts | .1.3.6.1.4.1.2021.50.1.101.2 |
Qmail - Messages - Deliveries | .1.3.6.1.4.1.2021.50.1.101.1 |
Qmail - Bits Transfer | .1.3.6.1.4.1.2021.50.2.101.1 |
Qmail - SMTP Concurrency | .1.3.6.1.4.1.2021.50.3.101.1 |
Qmail - SMTP Totals - Allow | .1.3.6.1.4.1.2021.50.4.101.1 |
Qmail - SMTP Totals - Deny | .1.3.6.1.4.1.2021.50.4.101.2 |
Qmail - Queue Size | .1.3.6.1.4.1.2021.50.5.101.2 |
Qmail - Queue Size - Unprocessed | .1.3.6.1.4.1.2021.50.5.101.1 |
Qmail - Messages Status - Failures | .1.3.6.1.4.1.2021.50.6.101.2 |
Qmail - Messages Status - Success | .1.3.6.1.4.1.2021.50.6.101.1 |
Qmail - Local/Remote Concurrency - Local | .1.3.6.1.4.1.2021.50.7.101.1 |
Qmail - Local/Remote Concurrency - Remote | .1.3.6.1.4.1.2021.50.7.101.2 |
Qmail - SpamAssassin - Clean Qmail - SpamAssassin - Spam Qmail - Clamav - Error Qmail - Clamav - Found