Hello,
I would like to check all Ip based elements that our system controls.
The idea is to ping each one of them.
Is there a way to send a ping from control script and wait specified period of time for response?
If yes, could you please give me an example?
Thanks in advance,
Vedad Ramovic
How to send ping and wait for ping back (reply)
- vedadramovic
- Posts:121
- Joined: Mon Apr 07, 2014 10:36 am
How to send ping and wait for ping back (reply)
- Gertjan van Schijndel
- Posts:634
- Joined: Mon Aug 02, 2010 10:37 am
Re: How to send ping and wait for ping back (reply)
The 'system()' function only rerturns when the executed command has finished. So you would not need to wait some specified period of time for the response.
In most projects network components are monitored with SNMP. Is this not a better option?
In most projects network components are monitored with SNMP. Is this not a better option?
- vedadramovic
- Posts:121
- Joined: Mon Apr 07, 2014 10:36 am
Re: How to send ping and wait for ping back (reply)
Hi Gertjan,
thank you for fast reply.
SNMP is not good enough solution for us for two reasons:
1. Most of elements that we control do not support SNMP.
2. At this stage we have plenty of power supply outages. In this case those elements cannot send SNMP trap.
Best regards,
Vedad
thank you for fast reply.
SNMP is not good enough solution for us for two reasons:
1. Most of elements that we control do not support SNMP.
2. At this stage we have plenty of power supply outages. In this case those elements cannot send SNMP trap.
Best regards,
Vedad
- vedadramovic
- Posts:121
- Joined: Mon Apr 07, 2014 10:36 am
Re: How to send ping and wait for ping back (reply)
System() along with startThread() works nice for tested situation (few IP addresses).
Thank you Gertjan.
Thank you Gertjan.
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: How to send ping and wait for ping back (reply)
If the devices have some listener port open, an option could be to check if you can connect to this port by using tcpOpen() with a timeout
- vedadramovic
- Posts:121
- Joined: Mon Apr 07, 2014 10:36 am
Re: How to send ping and wait for ping back (reply)
This is a good solution too.
Thank you Martin.
Thank you Martin.