Skip to content

Option to specify Nagios fields from environment variables#10

Open
divtxt wants to merge 2 commits intomasterfrom
nagios-params-from-env
Open

Option to specify Nagios fields from environment variables#10
divtxt wants to merge 2 commits intomasterfrom
nagios-params-from-env

Conversation

@divtxt
Copy link

@divtxt divtxt commented Mar 18, 2015

@mdcollins05 - please try this out.

  • fields sent by -f FOO="$FOO" via command_line can also be sent by -e FOO
  • requires enable env vars to be set

I just picked -e/--env-field - other suggestions welcome

cc @chamblin

@mdcollins05
Copy link
Contributor

I tested it out and it works as advertised! It handles quotes with no problems now.

Thanks!

@divtxt divtxt force-pushed the nagios-params-from-env branch from 4724821 to c627fb9 Compare March 20, 2015 21:07
@divtxt divtxt force-pushed the nagios-params-from-env branch from c627fb9 to f1e9903 Compare March 20, 2015 21:13
@divtxt
Copy link
Author

divtxt commented Mar 23, 2015

Added ICINGA support

bin/pd-nagios Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just do something like this instead?

if v is not None:
  details[f] = v

Otherwise, I imagine we'll be creating events with some "" => "" details fields.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could do. Though I'm not sure you'd get a blank key? I was leaning towards always sending the field even if the value is blank so that the user knows there's no bug in the pd parts of the stack.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. Yeah, this seems good.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a comment explaning!

@divtxt divtxt force-pushed the nagios-params-from-env branch from 499b571 to 4fa5297 Compare March 23, 2015 22:53
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chamblin
Copy link
Contributor

Nice! :shipit:

@divtxt
Copy link
Author

divtxt commented Mar 24, 2015

@mdcollins05 - would appreciate it if you can test the latest version on aws. (icinga testing too if that's easy) No rush.

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

Successfully merging this pull request may close these issues.

3 participants