Lcarr has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/55805


Change subject: removing the last files out of the nagios directory
......................................................................

removing the last files out of the nagios directory

Change-Id: Ief90d79d1dbf27d29d44b7568b8c7f4ad30c5ef9
---
R files/icinga/purge-nagios-resources.py
D files/nagios/page_all
D files/nagios/submit_check_result
M manifests/misc/icinga.pp
4 files changed, 1 insertion(+), 124 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/05/55805/1

diff --git a/files/nagios/purge-nagios-resources.py 
b/files/icinga/purge-nagios-resources.py
similarity index 100%
rename from files/nagios/purge-nagios-resources.py
rename to files/icinga/purge-nagios-resources.py
diff --git a/files/nagios/page_all b/files/nagios/page_all
deleted file mode 100755
index 9cae28c..0000000
--- a/files/nagios/page_all
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/bash
-# page (SMS) an arbitrary message to ALL Nagios contacts
-
-contacts_file="/etc/nagios/contacts.cfg"
-
-echo -e "! You are about to page ALL Nagios contacts.! \nWhat's the message? "
-read message
-
-echo -e "\nIt is $(date +"%l:%M%P"). The following contacts will be paged 
'$message'.\nTake a look at their local times before you continue.\n"
-
-for contact in $(grep -o "+[0-9]*" $contacts_file); do
-
-       area_code=${contact:1:2}
-
-       contact_name=$(grep -B1 $contact $contacts_file | xargs | cut -d " " 
-f2)
-
-       case "$area_code" in
-               1[0-9])
-                       location="US"
-                       us_area_code=${contact:2:3}
-
-                       # area code API lookup one-liner :p
-                       area_info=$(curl -s 
"http://www.allareacodes.com/api/1.0/api.xml?npa=${us_area_code}&[email protected]&tracking_url=http://nagios.wikimedia.org";
 | grep -o "<area_codes>.*</area_codes>" | sed -e :a -e 's/<[^>]*>/ 
/g;/</N;//ba');;
-               30)
-                       location="GR"
-                       area_info="  XXX  $location EET/EEST 
$(TZ="Europe/Athens" date +"%l:%M%P")  ";;
-               31)
-                       location="NL"
-                       area_info="  XXX  $location CET/CEST 
$(TZ="Europe/Amsterdam" date +"%l:%M%P")  ";;
-               49)
-                       location="DE"
-                       area_info="  XXX  $location CET/CEST 
$(TZ="Europe/Berlin" date +"%l:%M%P")  ";;
-               61)
-                       location="AU"
-                       area_info="  XXX  $location AEST/AED 
$(TZ="Australia/Sydney" date +"%l:%M%P")  ";;
-               *)
-                       location="Unknown"
-                       area_info="-";;
-       esac
-
-       printf '\t%-32s %-32s %-32s\n' "$contact_name" "$location" "$area_info"
-done
-
-echo -e "\nWhat do you want to do?\nall - page all anyways\nnous - exclude 
US\nnoeu - exclude Europe\nnoau - exclude Australia\nq - quit"
-
-read whattodo
-
-case "$whattodo" in
-
-       all)
-
-               for contact in $(grep -o "+[0-9]*" $contacts_file); do
-                       echo "$message - $LC_RUSER" | 
/usr/local/bin/gammu-smsd-inject TEXT $contact
-                       contact_name=$(grep -B1 $contact $contacts_file | xargs 
| cut -d " " -f2)
-                       printf '\t%-32s %-32s\n' "$contact_name" "$contact"
-               done;;
-       nous)
-
-               for contact in $(grep -o "+[0-9]*" $contacts_file | grep -v 
"+1[0-9]*"); do
-                       echo "$message - $LC_RUSER" | 
/usr/local/bin/gammu-smsd-inject TEXT $contact
-                       contact_name=$(grep -B1 $contact $contacts_file | xargs 
|  cut -d " " -f2)
-                       printf '\t%-32s %-32s\n' "$contact_name" "$contact"
-               done;;
-
-       noeu)
-
-               for contact in $(grep -o "+[0-9]*" $contacts_file | grep -v 
"+[34][0-9]*"); do
-                       echo "$message - $LC_RUSER" | 
/usr/local/bin/gammu-smsd-inject TEXT $contact
-                       contact_name=$(grep -B1 $contact $contacts_file | xargs 
| cut -d " " -f2)
-                       printf '\t%-32s %-32s\n' "$contact_name" "$contact"
-               done;;
-
-       noau)
-
-               for contact in $(grep -o "+[0-9]*" $contacts_file | grep -v 
"+[6][0-9]*"); do
-                       echo "$message - $LC_RUSER" | 
/usr/local/bin/gammu-smsd-inject TEXT $contact
-                       contact_name=$(grep -B1 $contact $contacts_file | xargs 
| cut -d " " -f2)
-                       printf '\t%-32s %-32s\n' "$contact_name" "$contact"
-               done;;
-       *)
-               echo "Nothing sent. Bye."
-               exit 0;;
-esac
diff --git a/files/nagios/submit_check_result b/files/nagios/submit_check_result
deleted file mode 100755
index 81e46b4..0000000
--- a/files/nagios/submit_check_result
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-# SUBMIT_CHECK_RESULT
-# Written by Ethan Galstad ([email protected])
-# Last Modified: 02-18-2002
-#
-# This script will write a command to the Nagios command
-# file to cause Nagios to process a passive service check
-# result.  Note: This script is intended to be run on the
-# same host that is running Nagios.  If you want to 
-# submit passive check results from a remote machine, look
-# at using the nsca addon.
-#
-# Arguments:
-#  $1 = host_name (Short name of host that the service is
-#       associated with)
-#  $2 = svc_description (Description of the service)
-#  $3 = return_code (An integer that determines the state
-#       of the service check, 0=OK, 1=WARNING, 2=CRITICAL,
-#       3=UNKNOWN).
-#  $4 = plugin_output (A text string that should be used
-#       as the plugin output for the service check)
-# 
- 
-echocmd="/bin/echo"
- 
-CommandFile="/var/log/nagios/rw/nagios.cmd"
- 
-# get the current date/time in seconds since UNIX epoch
-datetime=`date +%s`
-
-# make hostname correct for our nagios setup
-
-hostname=`echo $1 | awk -F . ' { print $1 } '`
-
-# create the command line to add to the command file
-cmdline="[$datetime] PROCESS_SERVICE_CHECK_RESULT;$hostname;$2;$3;$4"
- 
-# append the command to the end of the command file
-`$echocmd $cmdline >> $CommandFile`
diff --git a/manifests/misc/icinga.pp b/manifests/misc/icinga.pp
index 9d46a59..04260a2 100644
--- a/manifests/misc/icinga.pp
+++ b/manifests/misc/icinga.pp
@@ -253,7 +253,7 @@
 
     # Script to purge resources for non-existent hosts
      '/usr/local/sbin/purge-nagios-resources.py':
-      source => 'puppet:///files/nagios/purge-nagios-resources.py',
+      source => 'puppet:///files/icinga/purge-nagios-resources.py',
       owner  => 'root',
       group  => 'root',
       mode   => '0755';

-- 
To view, visit https://gerrit.wikimedia.org/r/55805
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief90d79d1dbf27d29d44b7568b8c7f4ad30c5ef9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Lcarr <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to