packages: nagios-plugin-check_solr/nagios-plugin-check_solr.spec, nagios-pl...
glen
glen at pld-linux.org
Tue May 29 13:02:23 CEST 2012
Author: glen Date: Tue May 29 11:02:23 2012 GMT
Module: packages Tag: HEAD
---- Log message:
- remove bash constructs
---- Files affected:
packages/nagios-plugin-check_solr:
nagios-plugin-check_solr.spec (1.1 -> 1.2) , bashism.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/nagios-plugin-check_solr/nagios-plugin-check_solr.spec
diff -u packages/nagios-plugin-check_solr/nagios-plugin-check_solr.spec:1.1 packages/nagios-plugin-check_solr/nagios-plugin-check_solr.spec:1.2
--- packages/nagios-plugin-check_solr/nagios-plugin-check_solr.spec:1.1 Tue May 29 12:58:48 2012
+++ packages/nagios-plugin-check_solr/nagios-plugin-check_solr.spec Tue May 29 13:02:18 2012
@@ -9,11 +9,12 @@
Source0: http://nagios-plugins-shamil.googlecode.com/svn/trunk/by_me/check_solr.sh
# Source0-md5: c53cf19008597b4d9a352ae28ad7127b
Source1: %{plugin}.cfg
+Patch0: bashism.patch
URL: https://code.google.com/p/nagios-plugins-shamil/
Requires: curl
+Requires: nagios-common
Requires: which
Requires: xmlstarlet
-Requires: nagios-common
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -27,11 +28,13 @@
%prep
%setup -qcT
+cp -p %{SOURCE0} .
+%patch0 -p1
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{plugindir}}
-install -p %{SOURCE0} $RPM_BUILD_ROOT%{plugindir}/%{plugin}
+install -p %{plugin}.sh $RPM_BUILD_ROOT%{plugindir}/%{plugin}
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg
%clean
@@ -48,5 +51,8 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.2 2012/05/29 11:02:18 glen
+- remove bash constructs
+
Revision 1.1 2012/05/29 10:58:48 glen
- new
================================================================
Index: packages/nagios-plugin-check_solr/bashism.patch
diff -u /dev/null packages/nagios-plugin-check_solr/bashism.patch:1.1
--- /dev/null Tue May 29 13:02:23 2012
+++ packages/nagios-plugin-check_solr/bashism.patch Tue May 29 13:02:18 2012
@@ -0,0 +1,80 @@
+--- nagios-plugin-check_solr/check_solr.sh~ 2011-08-10 16:54:07.000000000 +0300
++++ nagios-plugin-check_solr/check_solr.sh 2012-05-29 14:00:40.333361738 +0300
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # ============================== Summary =======================================
+ # Program : check_solr.sh
+ # Version : 2010.10.12
+@@ -13,7 +13,7 @@
+ # Notice: The plugin requires 'curl' and 'xmlstarlet' utilities in order to work
+ # ================================ Change log ==================================
+ # Legend:
+-# [*] Informational, [!] Bugix, [+] Added, [-] Removed
++# [*] Informational, [!] Bugfix, [+] Added, [-] Removed
+ #
+ # Ver 2010.10.12:
+ # [*] Replication check was improved a bit to avoid false alarms
+@@ -140,7 +140,7 @@
+ local OUTPUT=$(exec_curl "${URL_PREFIX}${O_SOLR_HOST}:${O_SOLR_PORT}/solr/$1/replication?command=details&wt=xml" |
+ xmlstarlet sel -t -v "/response/lst[@name='details']/str[@name='isSlave']")
+
+- [ "$OUTPUT" == "true" ] && return 0 || return 1
++ [ "$OUTPUT" = "true" ] && return 0 || return 1
+ }
+
+ # Get ping status of specified core
+@@ -154,7 +154,7 @@
+ local RESULT=$(exec_curl ${URL_PREFIX}${O_SOLR_HOST}:${O_SOLR_PORT}/solr/$1/admin/ping?wt=xml |
+ xmlstarlet sel -t -v "/response/str[@name='status']")
+
+- if [ "$RESULT" == "OK" ]; then
++ if [ "$RESULT" = "OK" ]; then
+ echo "OK"
+ return $STATE_OK
+ else
+@@ -216,7 +216,7 @@
+
+ # Return CRITICAL if slave isn't currently replicating
+ # and it's behind master for more then 1 hour (configurable)
+- if [ "$SLAVE_REPLICATING" == "false" -a $SLAVE_LASTREPLICATED -gt $SOLR_MAX_SECONDS_BEHIND_MASTER ]; then
++ if [ "$SLAVE_REPLICATING" = "false" -a $SLAVE_LASTREPLICATED -gt $SOLR_MAX_SECONDS_BEHIND_MASTER ]; then
+ echo "${SLAVE_LASTREPLICATED} seconds behind master => CRITICAL"
+ return $STATE_CRITICAL
+ fi
+@@ -243,7 +243,7 @@
+ }
+
+ # Print help if requested
+-if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
++if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
+ print_help
+ exit $STATE_UNKNOWN
+ elif [ $# -lt 2 ]; then
+@@ -300,7 +300,7 @@
+
+ # Check the metrics
+ # ping
+-if [ "$O_SOLR_METRIC" == "ping" ]; then
++if [ "$O_SOLR_METRIC" = "ping" ]; then
+ NAGIOS_OUTPUT="Ping -"
+
+ for core in $O_SOLR_CORE; do
+@@ -310,7 +310,7 @@
+ NAGIOS_OUTPUT="$NAGIOS_OUTPUT core '$core' $RESULT,"
+ done
+ # replication
+-elif [ "$O_SOLR_METRIC" == "replication" ]; then
++elif [ "$O_SOLR_METRIC" = "replication" ]; then
+ NAGIOS_OUTPUT="Replication -"
+
+ for core in $O_SOLR_CORE; do
+@@ -320,7 +320,7 @@
+ NAGIOS_OUTPUT="$NAGIOS_OUTPUT core '$core' $RESULT,"
+ done
+ # numdocs
+-elif [ "$O_SOLR_METRIC" == "numdocs" ]; then
++elif [ "$O_SOLR_METRIC" = "numdocs" ]; then
+ NAGIOS_OUTPUT="Number of documents -"
+ NAGIOS_PERF_OUTPUT=" |"
+
================================================================
---- CVS-web:
http://cvs.pld-linux.org/packages/nagios-plugin-check_solr/nagios-plugin-check_solr.spec?r1=1.1&r2=1.2
More information about the pld-cvs-commit
mailing list