Hello,
I've been trying to find an issue that seems like this one: http://www.zabbix.com/forum/showthread.php?t=20840
The issue is not:
So, what do I got?
I've created a Media Type called Twitter of type Script and Script name twitter.pl (the script's ownership is to the zabbix user and got the execute flag activated). Plus, that script is in the same path as configured in the AlertScriptsPath defined in the zabbix_server.conf file.
I've created an User Group that has read only access to all Host Groups.
Created then an user in that group called ScriptRunner. That user has a Media assigned. From the dropdown box it got Twitter assigned and the sendto field is twitter (it shoved that as first argument to the script as we can see below).
Testing it!
Under Audit (in Administration), selecting the Actions option on the right dropdown box I can see the action-type Twitter called, recipients twitter (as defined in the sendto field of the User's Media assignation).
The Subject and Message are exactly as I want for further parsing in the Perl script (then to truncate the message for twitters max length at will).
The Script!
I'm printing out the arguments the script receives. It is called by zabbix (remember I said I've tested it with zabbix user?) and drops a line on the log.
The script's argument is:
It generates the following command (both lines are printed on the log file).
Note: the timestamp is merely to ensure the same tweet is not posted twice. That is not possible.
ttytter.pl?
Yea, it's a pretty nice command line Perl interface for twitter. It can be configured to use OAuth so you don't have the credentials lying around on a clear text script.
So, what's really happening here? You seem to have it all alright
The point is that if I execute the script with zabbix's user, on the command line. BAM! The tweet shows up.
If zabbix does it, I get a new line in the log file but no twitter update. (?!?)
Is it possible to enable some kind of debug in zabbix so I can see when and how it tries to execute the script? I've tryed relative and absolute paths on different places... No luck.
Does it have some kind of timeout executing scripts? Because calling the ttytter command takes a couple seconds... Maybe I should try and run it as a daemon.
Thanks for the help. Will post the script when I get it to work.
I've been trying to find an issue that seems like this one: http://www.zabbix.com/forum/showthread.php?t=20840
The issue is not:
- Who is executing the script (I've executed it as zabbix user; su - zabbix)
- The permissions of the script (chmod a+x twitter.pl)
- Whatever you can think...
So, what do I got?
I've created a Media Type called Twitter of type Script and Script name twitter.pl (the script's ownership is to the zabbix user and got the execute flag activated). Plus, that script is in the same path as configured in the AlertScriptsPath defined in the zabbix_server.conf file.
I've created an User Group that has read only access to all Host Groups.
Created then an user in that group called ScriptRunner. That user has a Media assigned. From the dropdown box it got Twitter assigned and the sendto field is twitter (it shoved that as first argument to the script as we can see below).
Testing it!
Under Audit (in Administration), selecting the Actions option on the right dropdown box I can see the action-type Twitter called, recipients twitter (as defined in the sendto field of the User's Media assignation).
The Subject and Message are exactly as I want for further parsing in the Perl script (then to truncate the message for twitters max length at will).
The Script!
I'm printing out the arguments the script receives. It is called by zabbix (remember I said I've tested it with zabbix user?) and drops a line on the log.
The script's argument is:
Code:
twitter hostname name of the trigger -- status
Code:
/home/zabbix/bin/ttytter.pl -status="hostname name of the trigger -- status (timestamp)"
ttytter.pl?
Yea, it's a pretty nice command line Perl interface for twitter. It can be configured to use OAuth so you don't have the credentials lying around on a clear text script.
So, what's really happening here? You seem to have it all alright
The point is that if I execute the script with zabbix's user, on the command line. BAM! The tweet shows up.
If zabbix does it, I get a new line in the log file but no twitter update. (?!?)
Is it possible to enable some kind of debug in zabbix so I can see when and how it tries to execute the script? I've tryed relative and absolute paths on different places... No luck.
Does it have some kind of timeout executing scripts? Because calling the ttytter command takes a couple seconds... Maybe I should try and run it as a daemon.
Thanks for the help. Will post the script when I get it to work.

Comment