1 |
stephdl |
1.1 |
diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_netStats mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_netStats |
2 |
|
|
--- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_netStats 1970-01-01 01:00:00.000000000 +0100 |
3 |
|
|
+++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_netStats 2009-02-17 18:17:57.000000000 +0100 |
4 |
|
|
@@ -0,0 +1,32 @@ |
5 |
|
|
+# Some networks statistics |
6 |
|
|
+# zabbix agent support natively interface stats, but, it's hard to create templates for a lot of |
7 |
|
|
+# SME Servers which can use different interface name (External can be eth0, eth1, ppp0 etc...) |
8 |
|
|
+# This way, net.if.in.internal, net.if.in.external, net.if.out.internal and net.if.out.external |
9 |
|
|
+# will always refers to the correct interface. |
10 |
|
|
+ |
11 |
|
|
+{ |
12 |
|
|
+my $internal = $InternalInterface{'Name'} || 'eth0'; |
13 |
|
|
+my $external = $ExternalInterface{'Name'} || 'eth1'; |
14 |
|
|
+ |
15 |
|
|
+# Do we use the bridge contrib ? |
16 |
|
|
+# If yes, we reports only the traffic on the real ethernet interface. |
17 |
|
|
+if ( (($bridge{'status'} || 'disabled') eq 'enabled') && (defined $bridge{'ethernetInterface'}) ){ |
18 |
|
|
+ $internal = $bridge{'ethernetInterface'}; |
19 |
|
|
+} |
20 |
|
|
+ |
21 |
|
|
+$OUT .=<<"HERE"; |
22 |
|
|
+ |
23 |
|
|
+UserParameter=net.if.in.internal,cat /proc/net/dev | grep $internal | cut -d":" -f2 | awk '{print \$1}' |
24 |
|
|
+UserParameter=net.if.out.internal,cat /proc/net/dev | grep $internal | cut -d":" -f2 | awk '{print \$9}' |
25 |
|
|
+ |
26 |
|
|
+HERE |
27 |
|
|
+ |
28 |
|
|
+if (($SystemMode || 'serveronly') ne 'serveronly'){ |
29 |
|
|
+ $OUT .=<<"HERE"; |
30 |
|
|
+UserParameter=net.if.in.external,cat /proc/net/dev | grep $external | cut -d":" -f2 | awk '{print \$1}' |
31 |
|
|
+UserParameter=net.if.out.external,cat /proc/net/dev | grep $external | cut -d":" -f2 | awk '{print \$9}' |
32 |
|
|
+ |
33 |
|
|
+HERE |
34 |
|
|
+} |
35 |
|
|
+} |
36 |
|
|
+ |