Author: glen                         Date: Mon Dec 13 08:47:16 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- replace poller with shell version of the script

---- Files affected:
packages/cacti-template-nagiostats:
   cacti-template-nagiostats.spec (1.3 -> 1.4) , check_nagios.sh (NONE -> 1.1)  
(NEW)

---- Diffs:

================================================================
Index: packages/cacti-template-nagiostats/cacti-template-nagiostats.spec
diff -u packages/cacti-template-nagiostats/cacti-template-nagiostats.spec:1.3 
packages/cacti-template-nagiostats/cacti-template-nagiostats.spec:1.4
--- packages/cacti-template-nagiostats/cacti-template-nagiostats.spec:1.3       
Mon Dec 13 09:45:55 2010
+++ packages/cacti-template-nagiostats/cacti-template-nagiostats.spec   Mon Dec 
13 09:47:11 2010
@@ -5,12 +5,13 @@
 Summary:       Nagios Statistics - Cacti scripts and templates
 Name:          cacti-template-%{template}
 Version:       0.1
-Release:       0.5
+Release:       0.6
 License:       GPL v2
 Group:         Applications/WWW
 Source0:       http://forums.cacti.net/download/file.php?id=18185#/nacti.tar.gz
 # Source0-md5: 758d07f15a58c845169b3359bce837c5
 Source1:       cacti_host_template_nagios_statistics.xml
+Source2:       check_nagios.sh
 Patch0:                pld.patch
 URL:           http://forums.cacti.net/about33806.html
 BuildRequires: rpmbuild(macros) >= 1.554
@@ -34,11 +35,13 @@
 %setup -qc
 %patch0 -p1
 cp -a %{SOURCE1} .
+cp -a %{SOURCE2} .
+%{__sed} -i -e 's,check_nagios.pl,check_nagios.sh,' *
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{resourcedir},%{scriptsdir},%{nagioscgidir}}
-install -p check_nagios.pl $RPM_BUILD_ROOT%{scriptsdir}
+install -p check_nagios.sh $RPM_BUILD_ROOT%{scriptsdir}
 install -p mrtgstats.cgi $RPM_BUILD_ROOT%{nagioscgidir}
 
 cp -a *.xml $RPM_BUILD_ROOT%{resourcedir}
@@ -58,7 +61,7 @@
 %files
 %defattr(644,root,root,755)
 %doc README
-%attr(755,root,root) %{scriptsdir}/check_nagios.pl
+%attr(755,root,root) %{scriptsdir}/check_nagios.sh
 %{resourcedir}/*.xml
 
 # nagios-cacti-nagiostats
@@ -70,6 +73,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.4  2010/12/13 08:47:11  glen
+- replace poller with shell version of the script
+
 Revision 1.3  2010/12/13 08:45:55  glen
 - fix path to nagiostats
 

================================================================
Index: packages/cacti-template-nagiostats/check_nagios.sh
diff -u /dev/null packages/cacti-template-nagiostats/check_nagios.sh:1.1
--- /dev/null   Mon Dec 13 09:47:16 2010
+++ packages/cacti-template-nagiostats/check_nagios.sh  Mon Dec 13 09:47:11 2010
@@ -0,0 +1,20 @@
+#!/bin/sh
+# vim:ft=sh
+# enable for debugging:
+set -x
+exec 2>>/tmp/nagios-cacti.log
+#exec 1>&2
+
+url="$1"
+type="$2"
+user="$3"
+password="$4"
+
+# Remove trailing slash if needed
+url="${url%/}"
+
+# pass user and password conditionally.
+# this way we can even have passwords in them.
+# retry only once with timeout of 30s
+wget -t 1 -T 30 --no-check-certificate -q -O- ${user:+--user="$user" 
--password="$password"} "$url/mrtgstats.cgi?type=$type"
+echo $? >&2
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/cacti-template-nagiostats/cacti-template-nagiostats.spec?r1=1.3&r2=1.4&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to