-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Conversation
@@ -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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done !
c84a3ca
to
afd2b03
Compare
@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? |
@sparrc Doc added ! Thanks ! |
|
||
## Nagios: | ||
|
||
There are no additional configuration options for Nagios line-protocol. The |
There was a problem hiding this comment.
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
I'm ready to merge this, can you rebase first? |
79655e5
to
3a162e8
Compare
@sparrc done ! |
Hello ! This adds nagios parser for exec input plugin