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

Add nagios parser for exec input plugin #762

Closed
wants to merge 1 commit into from

Conversation

titilambert
Copy link
Contributor

Hello ! This adds nagios parser for exec input plugin

@@ -63,7 +64,12 @@ func (c CommandRunner) Run(e *Exec, command string) ([]byte, error) {
cmd.Stdout = &out

if err := cmd.Run(); err != nil {
return nil, fmt.Errorf("exec: %s for command '%s'", err, command)
switch e.parser.(type) {
case *nagios.NagiosParser:
Copy link
Contributor

Choose a reason for hiding this comment

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

why ignore errors for nagios commands?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because nagios plugins use exit code to indicate check status

  • 0 == OK
  • 1 == WARNING
  • 3 == CRITICAL
  • 4 or more == UNKNOWN

Maybe I should add a state metric for it ?

Copy link
Contributor

Choose a reason for hiding this comment

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

adding a state metric seems like a good idea, if that's possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done !

@titilambert titilambert force-pushed the nagios branch 3 times, most recently from c84a3ca to afd2b03 Compare March 3, 2016 02:22
@sparrc
Copy link
Contributor

sparrc commented Mar 14, 2016

@titilambert so is the nagios parser only applicable to the exec plugin? Could you also write something in the docs/DATA_FORMAT_INPUTS.md doc?

@titilambert
Copy link
Contributor Author

@sparrc Doc added !
and yes, only for exec plugin

Thanks !


## Nagios:

There are no additional configuration options for Nagios line-protocol. The
Copy link
Contributor

Choose a reason for hiding this comment

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

in here mention that the nagios parser is only for exec

@sparrc
Copy link
Contributor

sparrc commented Mar 18, 2016

I'm ready to merge this, can you rebase first?

@titilambert titilambert force-pushed the nagios branch 2 times, most recently from 79655e5 to 3a162e8 Compare March 19, 2016 02:40
@titilambert
Copy link
Contributor Author

@sparrc done !

@sparrc sparrc closed this in 8f09aad Mar 21, 2016
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.

2 participants