Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #5581] add more notification scripts and samples #1208

Closed
icinga-migration opened this issue Jan 30, 2014 · 12 comments
Closed
Labels
area/windows Windows agent and plugins enhancement New feature or request

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/5581

Created by mfriedrich on 2014-01-30 19:50:54 +00:00

Assignee: (none)
Status: Closed (closed on 2016-02-25 00:39:55 +00:00)
Target Version: (none)
Last Update: 2016-02-25 00:39:55 +00:00 (in Redmine)


For example https://wiki.icinga.org/display/howtos/Icinga+to+Prowl

But also https://git.icinga.org/?p=icinga-core.git;a=blob;f=sample-config/template-object/notifications.cfg.in;hb=HEAD

Attachments

  • email.png matty - 2014-03-15 02:38:55 +00:00 - email screenshot

Relations:

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-02-11 19:27:19 +00:00

  • Assigned to set to mfriedrich

@icinga-migration
Copy link
Author

Updated by matty on 2014-03-15 02:41:12 +00:00

  • File added email.png

Not sure if this counts but I have a email notification script that parses Icinga variables and displays them in a fairly easy to read format. The script is python and the template for the html email is jinja2.
https://github.com/mattyjones/icinga\_plugins

I have attached a screenshot of the email. I be posting a breakdown of how to configure and use this on my site and can add it to the wiki as well.

@icinga-migration
Copy link
Author

Updated by harvey on 2014-05-21 10:39:15 +00:00

I created sms notofication with gnokii - easy and successfull with one sms notification.
Sending sms to a group fails, because the use of gnoki is so fast, that the lock of gnokii does not work.
This results in two or more parallel attempts to send sms to the mobile, which is not working.
So I did a workaround with the mkdir command to creater a lockdir inside the sms-notification script.

This is my (works_for_me-style with lots of debugging output) workaround:

#!/usr/bin/env bash
template=$(cat <> /var/log/icinga2/gnokii.log
      break
   else
      now=`date "+%Y-%m-%d %T"`
      echo "#-#-#-UNHAPPY-2ND-LOCK#-#-# $now $$" >> /var/log/icinga2/gnokii.log

      sleep 10

      if [ -r $GNOKIILOCK ]; then
         find $GNOKIILOCK -mmin +15 --exec rmdir {} \;
      fi

# --- try 12 * 5 secs = 1 min
      for i in 1 2 3 4 5 6 7 8 9 10 11 12
      do
         if [ -r $GNOKIILOCK ]; then
            now=`date "+%Y-%m-%d %T"`
            echo "#-#-#-WAITING-${i}-TO-GO-AWAY-LOCK#-#-# $now $$" >> /var/log/icinga2/gnokii.log
            sleep 5
         else
            break
         fi
      done

      if [ -r $GNOKIILOCK ]; then
         now=`date "+%Y-%m-%d %T"`
         echo "#-#-#-PROBLEM-WITH-LOCK#-#-# $now $$" >> /var/log/icinga2/gnokii.log
         exit 1
      fi
   fi
done

now=`date "+%Y-%m-%d %T"`
echo "#-#-#-HOST----#-#-# $now" >> /var/log/icinga2/gnokii.log

/usr/bin/printf "%b" "$template" | sudo /usr/bin/gnokii --sendsms $USERPAGER  >> /var/log/icinga2/gnokii.log 2>&1

now=`date "+%Y-%m-%d %T"`
echo "#-#-#-END-----#-#-# $now" >> /var/log/icinga2/gnokii.log
echo "" >> /var/log/icinga2/gnokii.log

sleep 1

rmdir $GNOKIILOCK

exit 0

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-05-22 18:30:09 +00:00

  • Target Version set to 186

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-06-06 09:01:35 +00:00

  • Target Version deleted 186

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-06-13 22:07:10 +00:00

  • Assigned to deleted mfriedrich
  • Target Version set to 2.1.0

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-07-10 08:21:48 +00:00

  • Target Version deleted 2.1.0

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-09-16 09:12:50 +00:00

  • Project changed from 37 to Icinga 2
  • Category set to Plugins

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-01-12 09:36:58 +00:00

  • Relates set to 6714

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-01-12 09:39:24 +00:00

  • Relates set to 6736

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-01-12 15:25:52 +00:00

  • Description updated

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-02-25 00:39:56 +00:00

  • Status changed from New to Closed

@icinga-migration icinga-migration added enhancement New feature or request Plugins labels Jan 17, 2017
@dnsmichi dnsmichi added the area/windows Windows agent and plugins label May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/windows Windows agent and plugins enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants