Hello!

I've install and configure tweepy library to tweet action for host
and/or service, everything should be OK, but I got problem with
`conf.d/notifications.conf`.

My Notification are looks like :

.. [truncated] ..

apply Notification "tweet-icingaadmin" to Host {
  import "tweet-host-notification"
  assign where host.vars.notification.tweet == "True"
}

.. [truncated] ..

In conf.d/hosts.conf, I just add this line :

.. [truncated] ..
object Host "my-hosts" {

        vars.notification.tweet = "True"
.. [truncated] ..

The script for notifications `scripts/tweet-host-notification.sh`

#!/bin/sh
python=$(which python)
template=`cat <<TEMPLATE
$HOSTSTATE [ $HOSTALIAS ] $HOSTOUTPUT
TEMPLATE
`
$python /etc/icinga2/scripts/tweet-notification.py "$template"

And the last, the conf.d/commands.conf
.. [truncated] ..
object NotificationCommand "tweet-host-notification" {
  import "plugin-notification-command"

  command = [ SysconfDir + "/icinga2/scripts/tweet-host-notification.sh" ]

  env = {
    HOSTALIAS = "$host.display_name$"
    HOSTSTATE = "$host.state$"
    HOSTOUTPUT = "$host.output$"
  }
}
.. [truncated] ..

All python & bash script verified running using icinga users.
Then, I tried to reload the icinga2 daemon, it came with errors.

Logs: http://fpaste.org/262355/41177709/raw/
My question, where the tweet-icingaadmin refers to? It was same with
mail-icingaadmin, I can't find that vars refers to.

Any feedback/help are appreciated.
Many thanks.
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to