LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-20-2012, 09:59 AM   #1
jhackett
LQ Newbie
 
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
Nagios alerts w/ twitter using twurl


We've been using nagios for some time and have recently decided to change how we receive alerts. To this end, we've installed twurl ( https://github.com/marcel/twurl ) and are using it to send alerts. Unfortunately this logs alerts as having been sent, but none get to the monitor's twitter account. twurl uses a pretty standard CLI which looks like this (nagios macros left in tact):

`/usr/local/bin/twurl -d "status=d @$CONTACTEMAIL$ $NOTIFICATIONTYPE$: $TIME$ : $HOSTALIAS$ / $SERVICEDESC$ is $SERVICESTATE$ ($SERVICEOUTPUT$)" /1/statuses/update.xml`

Here's the notification command:

Code:
    define command {
	    command_name  	notify-service-by-twurl
	    command_line  	PATH="/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/nagios/bin"; HOME="/home/nagios"; /usr/local/bin/twurl -d "status=d @$CONTACTEMAIL$ $NOTIFICATIONTYPE$: $TIME$ : $HOSTALIAS$ / $SERVICEDESC$ is $SERVICESTATE$ ($SERVICEOUTPUT$)" /1/statuses/update.xml &>/tmp/lastcheck
    #	command_line	/bin/echo '/usr/local/bin/twurl -d "status=d @$CONTACTEMAIL$ $NOTIFICATIONTYPE$: $TIME$ : $HOSTALIAS$ / $SERVICEDESC$ is $SERVICESTATE$ ($SERVICEOUTPUT$)" /1/statuses/update.xml' > /tmp/foo
    }
Syntax works fine etc, no issues there. 1st line fires off the 2nd command_line line is to output the contents of the macros nagios uses, and returns what would be expected in all cases.

twurl pitfalls we've definitely avoided:

- we've authed to twitter for nagios's user (su'd in and checked, works
fine when done manually).
- the credentials of the app are correct (again, works fine when using
twurl manually)
- the settings of the twitter app ( on http://dev.twitter.com ) are
correct (set to read/write direct messages etc)

I can provide any specific pieces of information anyone might need for extra context but for now that's about it. Using the output from the commented 3rd line of the command definition I can see that twurl isn't authenticated, though it is authed with nagios's user. I believe this is because twurl uses a .twurlrc file with stored credentials, but I also suspect nagios does not use this when it runs.

If anyone knows of a way of making nagios use the .twurlrc / other files in the environment for a given command, this would, I suspect, solve the problem.

Any ideas?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] nagios alerts help mahmoud Linux - Software 8 01-07-2014 08:41 AM
Nagios Alerts via SMS PankajRasuni Linux - Server 3 03-31-2011 01:51 AM
Nagios alerts are not working shashij Linux - Software 2 03-15-2010 07:35 AM
Nagios Server Alerts deibertine Linux - Newbie 2 04-03-2009 07:00 PM
Nagios Alerts on Linux sachinh Linux - Newbie 1 11-05-2008 03:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration