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

Debugging pagerduty.pl #3

Open
steeef opened this issue Jul 10, 2014 · 15 comments
Open

Debugging pagerduty.pl #3

steeef opened this issue Jul 10, 2014 · 15 comments

Comments

@steeef
Copy link

steeef commented Jul 10, 2014

I've got everything configured in Nagios per the README, and I can see that Nagios is calling pagerduty.pl, but PagerDuty shows no new incidents.

As a test, I've tried using a wrapper script on the plugin to capture stderr and the exit code (http://www.waggy.at/nagios/capture_plugin.htm). The output is blank with exit code "0", so I assume that the API call is succeeding.

Running pagerduty.pl manually:

$ sudo -u nagios /usr/bin/env perl /usr/local/nagios/plugins/pagerduty.pl; echo $?
Use of uninitialized value in string eq at /usr/local/nagios/plugins/pagerduty.pl line 181.
Use of uninitialized value in string eq at /usr/local/nagios/plugins/pagerduty.pl line 197.
Use of uninitialized value in string eq at /usr/local/nagios/plugins/pagerduty.pl line 197.
Use of uninitialized value in string eq at /usr/local/nagios/plugins/pagerduty.pl line 197.
0

No obvious errors here other than missing environment variables, I believe.

Short of adding my own, is there any way to get verbose/debugging output?

@steeef
Copy link
Author

steeef commented Jul 10, 2014

Ah hah! I was issuing Custom notifications as a test. When I tried letting Nagios issue its own notification, it worked fine.

So I guess this is a two-parter: could the script also send alerts on custom notifications? I can submit a pull request if you'd like.

@itsjohannawren
Copy link
Owner

I'm going to check the messages from your first post because I don't like warnings. I did consider custom notifications when writing this, mainly because they may or may not have a global unique ID. I'll poke at it some tonight. (yay for PagerDuty test account status)

@steeef
Copy link
Author

steeef commented Jul 10, 2014

I've been customizing the script a bit too, but don't have a good way to test it. Added a few things:

  • Setting the author to the PagerDuty account's name.
  • Setting a fixed downtime of two hours in Nagios if the the message type is "incident.resolve".

@marcossantiago
Copy link

I am trying to integrate with Check_MK.

It works fine with Pagerduty script, but I got the same error trying to use your script:
Output: Use of uninitialized value in string eq at /omd/sites/prod/share/check_mk/notifications/pagerduty.pl line 181.
Output: Use of uninitialized value in string eq at /omd/sites/prod/share/check_mk/notifications/pagerduty.pl line 197.
Output: Use of uninitialized value in string eq at /omd/sites/prod/share/check_mk/notifications/pagerduty.pl line 197.
Output: Use of uninitialized value in string eq at /omd/sites/prod/share/check_mk/notifications/pagerduty.pl line 225.
Plugin: pagerduty.pl

  • Skipping: wrong notification type d (PROBLEM), only are allowed

Have any idea how can I solve that ?

Thanks in advance.

@marcossantiago
Copy link

Nothing ?

@steeef
Copy link
Author

steeef commented Aug 12, 2014

@marcossantiago That's what you'd see if you have enable_environment_macros set to 0. See that config setting on:
http://nagios.sourceforge.net/docs/3_0/configmain.html

@marcossantiago
Copy link

Hi @steeef !

Thank you for this. It worked right away. Did I miss any instructions ? Sorry for bothering in such a silly problem.

@steeef
Copy link
Author

steeef commented Aug 13, 2014

I couldn't find anything in the README here, but I believe @JeffWalter was assuming that you'd originally gone through the official PagerDuty Nagios integration instructions, which does mention that configuration variable:
http://www.pagerduty.com/docs/guides/nagios-perl-integration-guide/

@marcossantiago
Copy link

I had gone through that. But I totally missed it. Since was working fine for PD agent, I had assumed it should work fine.

Anyway, thank you for this.

@itsjohannawren
Copy link
Owner

Sorry guys, I've been really busy. I'm updating the readme to reflect the enable_environment_macros requirement. I've also got queueing coming. Next weekend I should have some queue monitoring as well.

@steeef
Copy link
Author

steeef commented Aug 14, 2014

Nice! This is a great plugin, btw. Thanks for the hard work here.

@itsjohannawren
Copy link
Owner

Don't forget to thank @m3matta (Mark Matta of PagerDuty) for hinting I should do it ;-)

@m3matta
Copy link

m3matta commented Aug 20, 2014

@JeffWalter it's all you. Really great to see other customers using it :)

@chrisgagne
Copy link

On behalf of PagerDuty, I've just issued a $100 bounty on BountySource to add more logging and other improvements as suggested in this issue. :) https://www.bountysource.com/issues/3065631-debugging-pagerduty-pl

@vegetableman
Copy link

@JeffWalter What changes are required to be added to close this issue?. Would like to submit a PR to close this issue. I can think of a check forenable_environment_macros env setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants