DX Infrastructure Management

BAT - Force compontent Rediscovery for all SNMPC profiles 

02-27-2017 03:05 AM

This is an example of how you can write a script to invoke Force Component Rediscovery for all SNMPcollector profiles

This is Windows script.

You can tweak / change to fit your environment.

 

set LIST=devicelist.txt
set PU="C:\Program Files (x86)\Nimsoft\bin\pu.exe"
set UIMUSER=administrator
set UIMPASS=password

del %LIST%
%PU% -u %UIMUSER% -p %UIMPASS% snmpcollector get_snmp_device ALL | findstr "ID" > %LIST%
for /f "tokens=3 delims= " %%i in (%LIST%) do (
%PU% -u %UIMUSER% -p %UIMPASS% snmpcollector rediscover_snmp_device %%i
TIMEOUT 10
)

Statistics
0 Favorited
5 Views
1 Files
0 Shares
1 Downloads
Attachment(s)
zip file
Rediscover_BAT.txt.zip   392B   1 version
Uploaded - 05-29-2019

Tags and Keywords

Comments

25 days ago

Hi,

We have 3 SNMP Collector. And this script is working fine only for 1 SNMPCollector. It is not working for remaining 2.

Do we need to make some changes in the script. please suggest.

03-12-2019 12:51 AM

Hi, Robert.

The reason I had to develop the script was part of troubleshooting.

Some customers experiencing snmpcollector probe metrics display missing in UMP, very often it was resolved by component rediscovery.

Manual re-discovery operation for mass target is headache, so I developed this.

 

03-11-2019 08:09 AM

Yu_Ishitani Thanks for the validation. When thinking about this, I am trying to identify what USE Cases we would need to execute this script for. In your experience when people implement this script is it something that runs one a day, or is this something that some type of logic would kick this script of if a scenario was to occur?

 

I guess I am just wondering how often would someone want to run this "on every device" In larger environments I would think this would place un-wanted load in some cases if ran to often?

03-11-2019 04:58 AM

Hi, Robert.

Sorry for late reply.

Yes. You are correct.

03-06-2019 08:59 AM

Yu_Ishitani I just want to make sure I understand this. To be clear this script runs and pulls the IDs from all SNMPCollector devices and then goes one by one and triggers them to run a component re-discover? Is this correct?

02-05-2019 08:02 AM

In the script, it sleeps 10 seconds in between loop since device rediscovery load vary device to device.

02-05-2019 05:39 AM

This is great! Question on the load that this might create? Is there a maximum number of devices that can or should be done at one time?

02-04-2019 05:32 PM

It is the name of a text file that will be created in the directory where you execute the batch file.

The outputs of the following command are redirected into that file with this command:

 

%PU% -u %UIMUSER% -p %UIMPASS% snmpcollector get_snmp_device ALL | findstr "ID" > %LIST%

Then this file is read in the "for loop" to process all of the devIDs returned by the get_snmp_device callback.

 

for /f "tokens=3 delims= " %%i in (%LIST%) do 

 

In the "for" loop, the rediscover_snmp_device callback is executed on each of the devices listed in the file.

02-04-2019 03:19 PM

Yu_Ishitani thank you very much for the contributions.

 

I have a question. You indicate this line (set LIST=devicelist.txt), but the devicelist.txt what is?

08-29-2018 08:49 AM

Thank you very much !

08-28-2018 02:13 PM

You are my hero of the week!  Thanks Yu!

02-12-2018 09:12 PM

Hi, thank you very much for question.

device ID is an internal ID automatically assigned by the probe.

02-08-2018 06:51 AM

Thanks Yu,

Are you using any specific data format for your devices.txt file? Is it the device IP, Name or the profile name as seen in snmpcollector?

Related Entries and Links

No Related Resource entered.