Non-Critical Host down = Warning?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
NeoMatrixJR
Posts: 28
Joined: Fri Dec 21, 2018 11:18 am

Non-Critical Host down = Warning?

Post by NeoMatrixJR »

Is there no option for this? I built a custom ping check that would return exit code 1 if a host was offline (warning) - I wanted this for non-critical hosts or other endpoints that may be off but we're tracking performance on. I want to know that they're off...but I don't want it showing as critical when I start looking through like...Nagios Fusion. Sadly...even with code 1 they show as "UP" - despite my code output showing up saying "offline"
danderson

Re: Non-Critical Host down = Warning?

Post by danderson »

Thanks for reaching out @NeoMatrixJR,

Unfortunately it doesn't seem like you can do a "warning" output for hosts. I believe it's only Up, Down, or Unreachable.

I suppose you could move that ping check to a service and have the check for the host just be something that always returns that it's fine, but I'm not sure that's what you would want.

Let me know if you need any more help.
NeoMatrixJR
Posts: 28
Joined: Fri Dec 21, 2018 11:18 am

Re: Non-Critical Host down = Warning?

Post by NeoMatrixJR »

Where do I post a feature request? I can think of a few ways in which this would be handy....
kg2857
Posts: 490
Joined: Wed Apr 12, 2023 5:48 pm

Re: Non-Critical Host down = Warning?

Post by kg2857 »

Look at the negate plugin which allows you to change the status returned. I've never used it on a host check so I might be wrong.
NeoMatrixJR
Posts: 28
Joined: Fri Dec 21, 2018 11:18 am

Re: Non-Critical Host down = Warning?

Post by NeoMatrixJR »

kg2857 wrote: Mon Jul 22, 2024 4:44 pm Look at the negate plugin which allows you to change the status returned. I've never used it on a host check so I might be wrong.
Thanks, but I think my issue is going to be with the base way in which Nagios operates. I don't think they even allow for a "warning" state for a host.
kg2857
Posts: 490
Joined: Wed Apr 12, 2023 5:48 pm

Re: Non-Critical Host down = Warning?

Post by kg2857 »

There is no base way nagios operates. Its up to the person setting up the checks.
If I read this right hosts can be in a warning state.
https://assets.nagios.com/downloads/nag ... hecks.html
gregbeyer
Posts: 181
Joined: Fri Sep 11, 2020 2:13 pm

Re: Non-Critical Host down = Warning?

Post by gregbeyer »

Perhaps you could put your non-critical hosts into a hostgroup "Non_critical" to segragate them so they don't "pollute" your list of truly critical. Also, turn off notification for those non-criticals. Hope this helps.
kg2857
Posts: 490
Joined: Wed Apr 12, 2023 5:48 pm

Re: Non-Critical Host down = Warning?

Post by kg2857 »

NeoMatrixJR wrote: Mon Jul 22, 2024 2:13 pm Is there no option for this? I built a custom ping check that would return exit code 1 if a host was offline (warning) - I wanted this for non-critical hosts or other endpoints that may be off but we're tracking performance on. I want to know that they're off...but I don't want it showing as critical when I start looking through like...Nagios Fusion. Sadly...even with code 1 they show as "UP" - despite my code output showing up saying "offline"
Run the command from the shell then echo $? to see the return status. 2 is warning. The text output is meaningless.
NeoMatrixJR
Posts: 28
Joined: Fri Dec 21, 2018 11:18 am

Re: Non-Critical Host down = Warning?

Post by NeoMatrixJR »

kg2857 wrote: Wed Jul 31, 2024 6:27 pm There is no base way nagios operates. Its up to the person setting up the checks.
If I read this right hosts can be in a warning state.
https://assets.nagios.com/downloads/nag ... hecks.html
kg2857 wrote: Sun Aug 11, 2024 2:41 am Run the command from the shell then echo $? to see the return status. 2 is warning. The text output is meaningless.
While it's possible for the scripts to return a warning state, Nagios from what I can see for hosts only has UP, DOWN, and UNREACHABLE. UP is green, DOWN is red, UNREACHABLE....I'm not sure. "Warning" can be considered UP or DOWN apparently according to documentation (still looking into changing these and only these hosts to be "green" when down), but there's no "yellow" state. I'm trying to work on our Nagios Fusion dashboard to not show these hosts as DOWN and ding our uptime reports and critical visibility as these "hosts" are a particular type of workstation that we're not really monitoring for being "up"....since these regularly go offline. We added them mostly to track CPU/Mem/Drive utilizations silently to get baseline data and monitor as software is deployed to ensure nothing causes resource issues at large.
kg2857
Posts: 490
Joined: Wed Apr 12, 2023 5:48 pm

Re: Non-Critical Host down = Warning?

Post by kg2857 »

Nagios sets the host status based on the return value (0-3) of the check. It has nothing to do with up, down, etc. There's a table in the doc that I linked that tells the states. I think the doc is a bit unclear in that it assumes you're using an ICMP check. There's nothing that says you have to use check_ping or check_icmp to check a host, or that you can't use the negate plugin to change the state. If you want the host check to return warning or unknown when its unreachable, you can make it happen.
Post Reply