[icinga-users] icinga-users Digest, Vol 8, Issue 28

Niranjan Babu Bommu niranjan.bommu at gmail.com
Fri Aug 22 19:54:59 CEST 2014


Pagerduty is working on this fix, I hope we will get new version of
pagerduty scripts soon.


On Fri, Aug 22, 2014 at 6:00 AM, <icinga-users-request at lists.icinga.org>
wrote:

> Send icinga-users mailing list submissions to
>         icinga-users at lists.icinga.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.icinga.org/mailman/listinfo/icinga-users
> or, via email, send a message with subject or body 'help' to
>         icinga-users-request at lists.icinga.org
>
> You can reach the person managing the list at
>         icinga-users-owner at lists.icinga.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of icinga-users digest..."
>
>
> Today's Topics:
>
>    1. Icinga 2 PagerDuty Integration (Dan Wardle)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 21 Aug 2014 23:41:38 -0700
> From: Dan Wardle <lets.troop at gmail.com>
> To: icinga-users at lists.icinga.org
> Subject: [icinga-users] Icinga 2 PagerDuty Integration
> Message-ID:
>         <
> CAAVzGJd-xzgWHrYpxNX7Zz-JF9ANuFyY08dX0kwGV33tRsSBRA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi folks
>
> I'm trying to get my Icinga 2 server to play nicely with my PagerDuty
> account. The PagerDuty/Icinga integration guide on the PD website is for
> Icinga 1, so I've been using the suggested configuration from this post
> https://lists.icinga.org/pipermail/icinga-users/2014-May/008201.html
>
> So far, all of my attempts to get events to be accepted by the PagerDuty
> server using this configuration have failed. I have, however, been able to
> have events accepted when I try to run pagerduty_icinga.pl from the
> terminal, but only if I specify the HOSTSTATE AND NOTIFICATIONTYPE values
> in uppercase:
>
> /usr/local/bin/pagerduty_icinga.pl enqueue -f pd_nagios_object=host -f
> HOSTNAME=pagerduty_test -f HOSTSTATE=DOWN -f NOTIFICATIONTYPE=PROBLEM -f
> CONTACTPAGER=<apikey>
>
> The same command with HOSTSTATE and NOTIFICATIONTYPE values in lowercase
> causes the event to be rejected by the server. From the syslog on the
> Icinga 2 server:
>
> Aug 21 23:36:03 mon-icinga2 pagerduty_icinga[15416]: Icinga event in file
> /tmp/pagerduty_icinga/pd_1408689363_15416.txt REJECTED by the PagerDuty
> server.  Server says: The NOTIFICATIONTYPE field must be present and must
> be one of: PROBLEM, ACKNOWLEDGEMENT, RECOVERY, NOP.
>
> Is there a way to get Icinga 2 to pass the variable values in uppercase
> rather than lowercase?
>
> Thanks in advance for any assistance!
> Dan
>
> pagerduty.conf:
>
> object NotificationCommand "notify-service-by-pagerduty" {
>    import "plugin-notification-command"
>    command = "/usr/local/bin/pagerduty_icinga.pl enqueue -f
> pd_nagios_object=service -f NOTIFICATIONTYPE=$NOTIFICATIONTYPE$ -f
> HOSTNAME=$HOSTNAME$ -f SERVICEDESC=$SERVICEDESC$ -f
> SERVICESTATE=$SERVICESTATE$"
>
>    env = {
>      "CONTACTPAGER" = "$user.pager$"
>      "NOTIFICATIONTYPE" = "$notification.type$"
>      "SERVICEDESC" = "$service.name$"
>      "HOSTNAME" = "$host.name$"
>      "HOSTALIAS" = "$host.display_name$"
>      "SERVICESTATE" = "$service.state$"
>      "SERVICEOUTPUT" = "$service.output$"
>    }
>
> }
>
> object NotificationCommand "notify-host-by-pagerduty" {
>    import "plugin-notification-command"
>    command = "/usr/local/bin/pagerduty_icinga.pl enqueue -f
> pd_nagios_object=host -f HOSTNAME=$HOSTNAME$ -f HOSTSTATE=$HOSTSTATE$ -f
> NOTIFICATIONTYPE=$NOTIFICATIONTYPE$"
>
>    env = {
>      "CONTACTPAGER" = "$user.pager$"
>      "NOTIFICATIONTYPE" = "$notification.type$"
>      "HOSTNAME" = "$host.name$"
>      "HOSTALIAS" = "$host.display_name$"
>      "HOSTSTATE" = "$host.state$"
>      "HOSTOUTPUT" = "$host.output$"
>    }
> }
>
> object User "pagerduty" {
>    display_name = "PagerDuty Notification User"
>    pager = "<apikey>"
> }
>
> apply Notification "pagerduty-service" to Service {
>    command = "notify-service-by-pagerduty"
>    states = [ OK, Warning, Critical, Unknown ]
>    types = [ Problem, Acknowledgement, Recovery, Custom ]
>    period = "24x7"
>    users = [ "pagerduty" ]
>
>    assign where service.vars.enable_pagerduty == true
> }
>
> apply Notification "pagerduty-host" to Host {
>    command = "notify-host-by-pagerduty"
>    states = [ Up, Down ]
>    types = [ Problem, Acknowledgement, Recovery, Custom ]
>    period = "24x7"
>    users = [ "pagerduty" ]
>
>    assign where host.vars.enable_pagerduty == true
> }
>
> object Service "pagerduty-test-service" {
>    import "generic-service"
>    check_command = "ping4"
>    host_name = "pagerduty-test-host"
>
>    vars.enable_pagerduty = true
> }
>
> object Host "pagerduty-test-host" {
>    import "generic-host"
>    address = "127.0.0.1"
>
>    vars.enable_pagerduty = true
> }
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.icinga.org/pipermail/icinga-users/attachments/20140821/4b87e5d8/attachment-0001.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> icinga-users mailing list
> icinga-users at lists.icinga.org
> https://lists.icinga.org/mailman/listinfo/icinga-users
>
>
> ------------------------------
>
> End of icinga-users Digest, Vol 8, Issue 28
> *******************************************
>



-- 
*Thanks*
*Niranjan*
*+1 781.956.6900*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.icinga.org/pipermail/icinga-users/attachments/20140822/feed1711/attachment.html>


More information about the icinga-users mailing list