Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Error in check_rubrik_runway.py Nagios plugin #3

Open
Gianlu opened this issue Dec 6, 2019 · 3 comments
Open

Error in check_rubrik_runway.py Nagios plugin #3

Gianlu opened this issue Dec 6, 2019 · 3 comments
Assignees
Labels

Comments

@Gianlu
Copy link

Gianlu commented Dec 6, 2019

Expected Behavior

The plugin can't monitor runaway time in the right way

Current Behavior

./check_rubrik_runway.py -s <ip> -u <user> -p <password> -w 180 -c 60
RUBRIK_RUNWAY CRITICAL - Days remaining is 156 (outside range 0:60) | 'Days remaining'=156;180;60;0

Failure Information (for bugs)
The check should be ok instead of critical

critical: Days remaining is 156 (outside range 0:60)
RUBRIK REST call returned "156"
| 'Days remaining'=156;180;60;0

Steps to Reproduce

`./check_rubrik_runway.py -s <ip> -u <user> -p <password> -w 180 -c 60`
`RUBRIK_RUNWAY CRITICAL - Days remaining is 156 (outside range 0:60) | 'Days remaining'=156;180;60;0`
@railroadmanuk
Copy link
Contributor

@Gianlu I think the format you should use when passing these is -w 180: -c 60:. This is how you define the range strings in Nagios, and is how this is defined by default.

@Gianlu
Copy link
Author

Gianlu commented Feb 3, 2020

Ok, I'll try and let you know

@connylandstedt
Copy link

connylandstedt commented Sep 21, 2020

We had similar issue, turned out we were missing the : (colon) after our values.

The format for RANGE can be read about in the API documentation for the nagiosplugin Rubrik opted to use at https://pythonhosted.org/nagiosplugin/api/intermediate.html#module-nagiosplugin.range
Stating:
The general format is “[@][start:][end]”. “start:” may be omitted if start==0. “~:” means that start is negative infinity. If end is omitted, infinity is assumed. To invert the match condition, prefix the range expression with “@”.

So if you omit the : (colon) at the end your values will be 0-to-(value) instead of (value)-to-(infinity) if you had the : (colon) at the end. Also according to the API documentation I'd guess prefixing the value with an @ to invert the match would have solved the issue as well.

According to my OP5/nagios resource at my company this is not usually how nagios checks are defined. The script in this case should take into account that you mean values above what you specify, since this is what the check is checking, and not assume that you know to add the : (colon).

Sure, it can be observed in the default value in the script, but it is not documented for the check_rubrik_runway.py script and explained that you need to format the value in this way.

I see a few things that could be done:

  1. Fix the documentation so it states how you should format the value. (Since you should not have to dig into the nagiosplugin API documentation to find out how to format the value)
    or/and
  2. Add to the script to add the : (colon) if it is omitted.
    I'd like to see both of above done.

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

Successfully merging a pull request may close this issue.

3 participants