/[smecontribs]/rpms/smeserver-zabbix-agent/contribs9/smeserver-zabbix-agent-0.1-net_stats.patch
ViewVC logotype

Contents of /rpms/smeserver-zabbix-agent/contribs9/smeserver-zabbix-agent-0.1-net_stats.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Tue Feb 9 23:18:26 2016 UTC (8 years, 9 months ago) by stephdl
Branch: MAIN
CVS Tags: smeserver-zabbix-agent-0_1-53_el6_sme, smeserver-zabbix-agent--, HEAD
* Wed Feb 10 stephane de Labrusse <stephdl@de-labrusse.fr> - 0.1-53.sme
- New rpm for sme9

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 +

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed