Page 5 of 6
Re: Possible to get ping status from private ip machines
Posted: Tue Jan 07, 2020 3:28 pm
by mbellerue
Oh, I'm sorry, if you have other checks using check_ncpa, then we should alter the service config file. My apologies, go ahead and revert the command.cfg file so that your other checks work.
Alter your service configuration so that the check command looks like this,
Code: Select all
check_command check_ncpa!ASecretToken -M plugins/check_ping -a '-H <internal_IP> -w 70,2% -c 80,5%'
Re: Possible to get ping status from private ip machines
Posted: Wed Jan 08, 2020 6:07 am
by epixelitsupport
bad luck ... Not Working for me .. still showing the same
Here is my commands I'm using .. one is checking the script for checking service in the same server. the script is working via ncpa
but the ping to private IP is not still working, i have changed the commands as you said
https://prnt.sc/qks3p8
Here is the Nagios Dashboard
https://prnt.sc/qks54u
https://prnt.sc/qks5ha
Re: Possible to get ping status from private ip machines
Posted: Thu Jan 09, 2020 10:07 am
by tacolover101
are your logs showing anything at all around a credential not working? based on the status it looks like it may not be executing because of this.
how is the command check_ncpa defined? what text have you hidden behind the black boxes?
Re: Possible to get ping status from private ip machines
Posted: Thu Jan 09, 2020 10:28 am
by mbellerue
Ah, I think I see the issue now. I missed it when we made the switch back to how you had the command defined before. Make your check_command look like this.
Code: Select all
check_command check_ncpa!-t 'ASecretToken' -M plugins/check_ping -a '-H <internal_IP> -w 70,2% -c 80,5%'
I forgot the -t. Also, personally, I like to wrap strings like the token in quotes. But if your working command doesn't have it in quotes, then that's fine too.
Re: Possible to get ping status from private ip machines
Posted: Thu Jan 09, 2020 1:46 pm
by epixelitsupport
Aha, You're Awesome !!!! That one is Worked For me .. Thank you for the whole support!!!
Can I ask you something more?
Like can I check a service running status in the machine with private IP ( pinging machine) !!! Do you have a solution for it?
Re: Possible to get ping status from private ip machines
Posted: Thu Jan 09, 2020 2:17 pm
by mbellerue
In theory you could do the same thing you did with check_ping, except use the check_ncpa.py plugin. Then install NCPA on the internal machine.
However, I would strongly advise that you limit the number of checks you pass through NCPA via the machine with the external IP. NCPA was not designed to work this way, and we don't have any idea how many checks would be too many checks for this type of setup. It works for ping, it will probably work for an additional check, or two. But don't push it too hard.
If you find yourself needing more checks on that remote network, you might be better off just having a Nagios installation on the network.
Re: Possible to get ping status from private ip machines
Posted: Thu Jan 09, 2020 2:22 pm
by epixelitsupport
your Right. But I'm looking to check a custom service status check-in Private IP Server, I just want to check one more custom services in Private IP server
Re: Possible to get ping status from private ip machines
Posted: Thu Jan 09, 2020 3:17 pm
by mbellerue
Okay, are you allowed to install NCPA on the machine with the internal IP address? If so, just copy check_ncpa.py from your Nagios server over to the machine with the external IP address, and then build your check command. You will do basically the same process that you did with check_ping. Your end command might look something like this.
Code: Select all
check_command check_ncpa!-t 'ASecretToken' -M plugins/check_ncpa.py -a "check_ncpa.py -H <internal_IP> -t '<internal_token>' -M 'services' -q 'service=<your_service_name>,status=running'"
Please make careful note of the usage of single and double quotes.
Everything you need should be in this thread, and you can use your existing check_ping service as a guide.
Re: Possible to get ping status from private ip machines
Posted: Thu Jan 09, 2020 3:37 pm
by epixelitsupport
I didn't get the point correctly. Can you just make me clear? where do I need to install NCPA?
and where should I run the commands?
where do I need to copy check_ncpa.py?
Please make me clear about it
very grateful to you
Re: Possible to get ping status from private ip machines
Posted: Thu Jan 09, 2020 4:38 pm
by benjaminsmith
Hello
@epixelitsupport,
Glad Michael was able to help you set up the ping check on the private host with NCPA.
If you'd like to set this up for another service, follow the same process as described in this post.