What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Monitor when IP address come online

Votes:

0

Hi,

Another question. What is the best way to monitor when an IP address becomes responsive?

I want to be able to know when a particular backup DLS line becomes active as it is a backup line and not on normally.

Thanks

John

dsl monitor prtg

Created on Jun 27, 2012 2:11:34 PM



Best Answer

Accepted Answer

Votes:

0

Hi,

This can be done with a batch file sensor.

In the "Custom Sensors\EXE" folder of your PRTG installation, create a new file called PingReverse.bat and paste the following code.

@echo off
ping -n 1 %1|Findstr /I /C:"timed out" /C:"host unreachable" > null
if %errorlevel% == 0 goto error
echo 0:Device is online
rem set sensor to error by returning 2
exit 2
goto end
:error
echo 0:Device is offline
rem set sensor to Ok by returning 0
exit 0
:end

You might need to change the "timed out" and "host unreachable" strings to meet the localized output of your ping command.

Note: do NOT name the batch file ping.bat, this will create an endless loop.

Regards,

Created on Jun 28, 2012 9:45:23 AM



3 Replies

Votes:

0

If the device has got an open port, when it is running, you can use a port sensor. In the settings you can set "Goal" to "Closed". Now the sensor is green, if the port is unavailable and it becomes red, as soon as the port opens. You can now use a notification if the sensor goes into error state.

Created on Jun 27, 2012 4:34:40 PM by  Johannes Herrmann [Paessler Support] (1,360) 2 2



Accepted Answer

Votes:

0

Hi,

This can be done with a batch file sensor.

In the "Custom Sensors\EXE" folder of your PRTG installation, create a new file called PingReverse.bat and paste the following code.

@echo off
ping -n 1 %1|Findstr /I /C:"timed out" /C:"host unreachable" > null
if %errorlevel% == 0 goto error
echo 0:Device is online
rem set sensor to error by returning 2
exit 2
goto end
:error
echo 0:Device is offline
rem set sensor to Ok by returning 0
exit 0
:end

You might need to change the "timed out" and "host unreachable" strings to meet the localized output of your ping command.

Note: do NOT name the batch file ping.bat, this will create an endless loop.

Regards,

Created on Jun 28, 2012 9:45:23 AM



Votes:

0

Thanks for your suggestions. Either will work for my needs!

Created on Jun 28, 2012 11:38:31 AM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.