I have a web site ( http ) access can be done by 3 ip in data center distributed .

I need a sensor that performs the test ( nslookup ) to show the IP address active for the web site.

Example

C:\Users\>nslookup

> server 8.8.8.8 server: google-public-dns-a.google.com Address: 8.8.8.8

> paessler.com Server: google-public-dns-a.google.com Address: 8.8.8.8

Name: paessler.com Address: 62.146.25.20

The sensor show address IP (62.146.25.20) - On my monitor I can show the active IP .


Article Comments

Hi Max,

Depending on the exact output of your local nslookup.exe, something like this will do as a batch sensor.

@echo off
for /F "tokens=2" %%a in ('nslookup paessler.com 8.8.8.8') do (
  set value=%%a 
)
echo 0:%value%

It returns the part of the last nslookup.exe output line after the first white space.

In the example above this will be:

0:62.146.25.20

May, 2015 - Permalink

I created an EXE Sensor to perform the nslookup testing and validating access my web page and passes the information to the sensor.

Sensor Parameter = 1% put the IP address of the server nslookup .

https://www.paessler.com/manuals/prtg/exe_script_advanced_sensor

example :

@echo off 
nslookup server %1 > nul
for /f "skip=1 tokens=2 delims=: " %%a in ('nslookup paessler.com %1 ^| find /v "Aliases"') do set dns_result=%%a
if %dns_result%==62.146.25.20 (echo 0:OK - Data Center DE - %dns_result% && EXIT /B 0) 
if %dns_result%==83.169.55.10 (echo 0:OK - Data Center DE - %dns_result% && EXIT /B 0) 
if %dns_result%==74.208.254.20  (echo 1:warning - Data Center US - %dns_result% && EXIT /B 1)
if %dns_result%==%1 (echo 2:Erro - Access site unavailable DNS - %dns_result% && EXIT /B 2)

May, 2015 - Permalink

Hi,

I just tried your code, but i'm getting the following error: This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.

Could you tell us more about how to set this up?


Jun, 2018 - Permalink

Hello Wouter,

This looks like that the variable got not filled correctly. Did you enter the IP address in the parameter field of the settings of the sensor?

Best regards, Felix


Jun, 2018 - Permalink

Show the active IP - Web Site ( http\https ) - nslookup

The value of the 1% variable will be added in the EXE / SCRIPT sensor configuration.

In the Parameters field, you must add the IP address (8.8.8.8) of the external DNS server, which will be used to perform the tests.

https://i.imgur.com/zqyAp66.png

In the example I use google's DNS, but you can use others.

DNS GOOGLE - 8.8.8.8

DNS opendns - 208.67.222.222

DNS opendns - 208.67.220.220

SENSOR SETTINGS - EXE/SCRIPT

Parameters If your executable or script file catches command line parameters, you can define them here. You can use placeholders as well.

icon-book-arrows For a full list of all placeholders please see the API documentation: Application Programming Interface (API) Definition)

Note: Please make sure you write the placeholders in quotes to ensure that they are working properly if their values contain blanks. Use single quotation marks ' ' with PowerShell scripts, and double quotes " " with all others. Please enter a string or leave the field empty.

https://www.paessler.com/manuals/prtg/exe_script_sensor https://kb.paessler.com/users/Zarate%20Max

Zarate Max


Jun, 2018 - Permalink

PRTG Manual: DNS v2 Sensor

The DNS v2 sensor monitors a Domain Name System (DNS) server, resolves domain name records, and compares them to a filter.

https://www.paessler.com/manuals/prtg/dns_v2_sensor

Why DNS monitoring matters

https://blog.paessler.com/why-dns-monitoring-matters-and-what-prtg-can-do-for-you


Jul, 2021 - Permalink