How to : OK if Host Down, Crit if Host up

Hello

I use Check_mk 1.6.0.p17 Raw.

Yes … I know, that’s another unusual question …

On my supervision, a host is down, so of course I have a “DOWN” message, this is normal … And I have CRIT with Check_MK (this is also normal).

But generally this VM is down, we start it “only” if we have problems to solve.

Is it possible not to have Allert when the VM is down and Alert when it is active?

Thank you

Hi,
Checkmk RAW or Enterprise Edition?

Karl

Sorry, I forgot this information, I will edit the firt message.

I use 1.6.0.p17 Raw

Hi,
in the Enterprise Edition there’s the rule “Host state translation” for this.

In the RAW edition you can setup a notification for this host and configure “Match host event type” (screenshot)

Karl

1 Like

Hello Karl, thanks for your time.

I tried this but the VM strayed “Down”.

However, I found a solution (not in production, but I am confident).

On the Check_mk server, I will create a script like this:

#!/bin/bash 

if ping -c 1 192.168.1.2 &> /dev/null
then
        status="2"
        statustxt="Warning ! VM is UP"
else
        status="0"
        statustxt="It's OK, VM is Down"
fi
echo "$status check_status_VM - $statustxt"

I will have:

$ ./test_ping.sh 
0 check_status_VM - It"s OK, VM is Down

$ ./test_ping.sh 
2 check_status_VM - Warning ! VM is UP

If I move it on /usr/lib/check_mk_agent/local

And “normaly” my Check_mk Server will show a probleme if the VM is UP ^^

You can also use the classic Nagios “check” negate.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.