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

Probe IP address sensor

Votes:

0

I want to set a sensor on our Probes that will show the local IP address of the device. How can I accomplish this?

ip ip-address sensor

Created on Mar 13, 2012 1:37:38 AM



Best Answer

Accepted Answer

Votes:

0

Something like this will do in a batch file sensor:

@echo off
IPCONFIG |FIND "IPv4 Address" > %temp%\TEMPIP.txt
FOR /F "tokens=2 delims=:" %%a in (%temp%\TEMPIP.txt) do (
set ip=%%a
goto end
)
:end
del %temp%\TEMPIP.txt

set "space= "
for /f "tokens=* delims=%space%" %%a in ("%ip%") do set "ip=%%a"
echo 0:%ip%

Depending on the localized output if the ipconfig command, "IPv4 Address" must be replaced by "IP Address", "IP-adres", "IP-Adresse" or something simular

Created on Mar 14, 2012 1:58:37 PM

Last change on Mar 23, 2012 3:29:23 PM by  Torsten Lindner [Paessler Support]



6 Replies

Votes:

0

Hello,

that should be possible using a Custom Exe Sensor parsing the output of an ipconfig /all command.

best regards.

Created on Mar 13, 2012 4:25:02 PM by  Torsten Lindner [Paessler Support]



Accepted Answer

Votes:

0

Something like this will do in a batch file sensor:

@echo off
IPCONFIG |FIND "IPv4 Address" > %temp%\TEMPIP.txt
FOR /F "tokens=2 delims=:" %%a in (%temp%\TEMPIP.txt) do (
set ip=%%a
goto end
)
:end
del %temp%\TEMPIP.txt

set "space= "
for /f "tokens=* delims=%space%" %%a in ("%ip%") do set "ip=%%a"
echo 0:%ip%

Depending on the localized output if the ipconfig command, "IPv4 Address" must be replaced by "IP Address", "IP-adres", "IP-Adresse" or something simular

Created on Mar 14, 2012 1:58:37 PM

Last change on Mar 23, 2012 3:29:23 PM by  Torsten Lindner [Paessler Support]



Votes:

0

How do I set the EXE sensor to pull that information that is dumped to the file?

Created on Mar 19, 2012 7:48:19 PM



Votes:

0

Hi Will,

There is no need to pull information from a file. Simply create a new .bat file in the "Custom Sensor/EXE" folder of your PRTG installation, paste the code above and that's the complete sensor.

Regards,

Created on Mar 19, 2012 9:09:40 PM



Votes:

0

Thanks for the response. When I created the sensor it immediately went down and I could not get it to respond.

Created on Mar 20, 2012 11:07:48 AM



Votes:

0

Hi Will,

You are right, PRTG does not like the white space at the beginning of the response. The script returned something like

0: 192.168.1.1

what needed to be

0:192.168.1.1

I modified the script to remove the white space.

Regards,

Created on Mar 22, 2012 10:01:07 AM

Last change on Jun 2, 2015 12:31:18 PM by  Luciano Lingnau [Paessler]




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.