Page 4 of 6

Re: Possible to get ping status from private ip machines

Posted: Tue Jan 07, 2020 11:22 am
by mbellerue
If you don't already have a check_ncpa command defined in commands.cfg, that will be pretty easy to take care of. I would recommend something like this.

Code: Select all

define command {
        command_name            check_ncpa
        command_line            $USER1$/check_ncpa.py -H $HOSTADDRESS$ -t $ARG1$ -M $ARG2$ -a $ARG3$
}
For your service definition, your check_command will look something like this,

Code: Select all

check_command    check_ncpa!ASecretToken!plugins/check_ping!'-H <internal_IP> -w 70,2% -c 80,5%'

Re: Possible to get ping status from private ip machines

Posted: Tue Jan 07, 2020 2:10 pm
by epixelitsupport
I added Service Like this in cfg file

https://prnt.sc/qkilu0
but im getting critical error in nagios dashboard . https://prnt.sc/qkimd9


When i click on it https://prnt.sc/qkims0

Can you suggest me a solution

Re: Possible to get ping status from private ip machines

Posted: Tue Jan 07, 2020 2:33 pm
by mbellerue
Can you post your check_ncpa command definition from commands.cfg? I think the issue may be there.

Re: Possible to get ping status from private ip machines

Posted: Tue Jan 07, 2020 2:38 pm
by epixelitsupport
here it is

define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}

Re: Possible to get ping status from private ip machines

Posted: Tue Jan 07, 2020 2:47 pm
by mbellerue
Ah, there it is. It's only expecting 1 argument, and we're passing 3. Change it to this, and we should be good to go.

Code: Select all

command_line            $USER1$/check_ncpa.py -H $HOSTADDRESS$ -t $ARG1$ -M $ARG2$ -a $ARG3$

Re: Possible to get ping status from private ip machines

Posted: Tue Jan 07, 2020 2:51 pm
by epixelitsupport
I CHANGES AS YOU MENTIONED SO IM GETTING THIS ERROR

https://prnt.sc/qkj5le

SO SETTINGS ARE REVERTED BACK

Re: Possible to get ping status from private ip machines

Posted: Tue Jan 07, 2020 2:57 pm
by mbellerue
That's progress though. That error message 'Incorrect credentials given' means that Nagios actually reached out to NCPA on the remote machine. So now go into your service definition and verify that your token is correct.

Re: Possible to get ping status from private ip machines

Posted: Tue Jan 07, 2020 3:06 pm
by epixelitsupport
so you mean it will get work>?

okay let me do that

Re: Possible to get ping status from private ip machines

Posted: Tue Jan 07, 2020 3:14 pm
by mbellerue
It will work, once you verify that your token is correct. Because right now, NCPA is saying that it doesn't recognize the token that you gave it.

Re: Possible to get ping status from private ip machines

Posted: Tue Jan 07, 2020 3:20 pm
by epixelitsupport
i dont think so... token looks correct
and all my servers which installed ncpa becomes unknown https://prnt.sc/qkjhzn