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.
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post by epixelitsupport »

yea I tried that way but from the host server the script is working but when I'm trying from the Nagios server I'm getting output like https://prnt.sc/qf15ff

Can you write for me an exact code to work it well?
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post by epixelitsupport »

when i go for another script https://prnt.sc/qf1bn7 im getting a warning message in nagios server instead of Critical message

Can you please tell me the issue and how it makes Critical once the ping is failed?

This is what im getting in Nagios Server: https://prnt.sc/qf1c5p
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post by epixelitsupport »

how to check a remote service status ?
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Possible to get ping status from private ip machines

Post by epixelitsupport »

can you please tell me why im getting this error when im running a command like this

https://prnt.sc/qfby4p
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, let's troubleshoot one issue at a time here. Let's stick to the ping check and get that working first.

So for this screenshot, https://prnt.sc/qf15ff it doesn't like the double square brackets. Let's try the double square brackets as single square brackets. For example,

Code: Select all

while [ $count -ne 0 ] ; do
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 »

currently, I'm using the below script to check it , if it is pinging right im getting and okay status if the ping fail im getting the Critical status , since I'm not passing any arguments if the condition fails

#!/bin/bash
ping -c1 10.47.76.119 > /dev/null
if [ $? -eq 0 ]
then
echo ok
exit 0
else
exit 2

fi

what is the exact format to pass the arguments correctly in Nagios?
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 completely overlooked the fact that we are running this script on a Linux machine. You can probably just copy over check_ping from your Nagios machine, and call that. That will likely be easier. My apologies for not connecting the dots sooner.
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 »

is this correct one?
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 »

It didn't get attached. But it's the check_ping file in /usr/local/nagios/libexec/ on your Nagios server.
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 think you didn't get my Question So far,

I am using NCPA to check ping status by using a script, Since I'm checking the ping status of another system( not installed ncpa, nrpe in it ) it has only access from the host server, no other external communication to that machine

I can only use the check ping if I have installed nrpe and also it should have an external IP to connect internet I guess,

In my case, the host machine only having access to the particular machine and i want to know the live ping status of the same machine which doesn't have an external IP to connect Internet
Locked