Possible to get ping status from private ip machines

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.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Possible to get ping status from private ip machines

Post 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%'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post 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
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Possible to get ping status from private ip machines

Post 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?
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Possible to get ping status from private ip machines

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post 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?
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Possible to get ping status from private ip machines

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post 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
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Possible to get ping status from private ip machines

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post 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
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Possible to get ping status from private ip machines

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked