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

Contents of /rpms/smeserver-zabbix-agent/contribs9/smeserver-zabbix-agent-0.1-userparam_lvm.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:27 2016 UTC (8 years, 2 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/sudoers/00zabbixAgentAlias mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/00zabbixAgentAlias
2 --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/00zabbixAgentAlias 2010-09-02 17:19:39.000000000 +0200
3 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/00zabbixAgentAlias 2010-09-02 17:19:24.000000000 +0200
4 @@ -1,5 +1,5 @@
5 {
6 -my $runasroot = '/usr/bin/mysqladmin status, /sbin/e-smith/db yum_updates show, /var/lib/zabbix/bin/sensors *, /usr/sbin/smartctl -A /dev/*';
7 +my $runasroot = '/usr/bin/mysqladmin status, /sbin/e-smith/db yum_updates show, /var/lib/zabbix/bin/sensors *, /var/lib/zabbix/bin/check_lvm *, /usr/sbin/smartctl -A /dev/*';
8 if ( -x '/opt/MegaRAID/MegaCli/MegaCli' ){
9 $runasroot .= ', /var/lib/zabbix/bin/megaraid-parser.pl';
10 }
11 diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_lvm mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_lvm
12 --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_lvm 1970-01-01 01:00:00.000000000 +0100
13 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_lvm 2010-09-02 17:18:51.000000000 +0200
14 @@ -0,0 +1,10 @@
15 +
16 +# Type: Agent or Agent (active)
17 +# Key: lvm[key] where key can be snapshot_max_allow, snapshots, lv or vg
18 +# Type of information: Numeric (integer 64bit) or characters (for version)
19 +# Units: depends on the key (snapshot_max_alloc is in %)
20 +# Custom multiplier: Do not use
21 +# Store Value: As is
22 +
23 +UserParameter=lvm[*],/usr/bin/sudo /var/lib/zabbix/bin/check_lvm $1
24 +
25 diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/check_lvm mezzanine_patched_smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/check_lvm
26 --- smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/check_lvm 1970-01-01 01:00:00.000000000 +0100
27 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/check_lvm 2010-09-02 17:16:51.000000000 +0200
28 @@ -0,0 +1,34 @@
29 +#!/bin/bash
30 +
31 +snapshot_max_alloc(){
32 + MAX_PERCENT=0
33 +
34 + for PERCENT in $(lvdisplay | grep % | sed -e 's/ Allocated to snapshot //g' -e 's/%//g'); do
35 + if [[ "$PERCENT" > "$MAX_PERCENT" ]]; then
36 + MAX_PERCENT=$PERCENT
37 + fi
38 + done
39 +
40 + echo "$MAX_PERCENT"
41 +}
42 +
43 +snapshots(){
44 + echo $(lvdisplay | grep % | wc -l)
45 +}
46 +
47 +lv(){
48 + echo $(lvdisplay | grep 'LV Name' | wc -l)
49 +}
50 +
51 +vg(){
52 + echo $(vgdisplay | grep 'VG Name' | wc -l)
53 +}
54 +
55 +case $1 in
56 + snapshot_max_alloc|snapshots|lv|vg)
57 + $1
58 + ;;
59 + *)
60 + echo 'ZBX_NOTSUPPORTED'
61 +esac
62 +

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