New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Probe IP address sensor

Votes:

0

Your Vote:

Up

Down

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 by  Will Fox (0) 1



Best Answer

Accepted Answer

Votes:

0

Your Vote:

Up

Down

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 by  PRTG Tools Family [prtgtoolsfamily.com] (12,915) 3 4

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



6 Replies

Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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 by  PRTG Tools Family [prtgtoolsfamily.com] (12,915) 3 4

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



Votes:

0

Your Vote:

Up

Down

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 by  Will Fox (0) 1



Votes:

0

Your Vote:

Up

Down

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 by  PRTG Tools Family [prtgtoolsfamily.com] (12,915) 3 4



Votes:

0

Your Vote:

Up

Down

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 by  Will Fox (0) 1



Votes:

0

Your Vote:

Up

Down

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 by  PRTG Tools Family [prtgtoolsfamily.com] (12,915) 3 4

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



Please log in or register to enter your reply.


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.