Run the Device Locator Program
To run the program, you will require the .exe file for the program, along with the program’s libraries which are configuration file (.csv) and log xml file (.xml). For the configuration file, it will look for a file named ‘devicelocatorconfig.csv’, and for the log properties file, it will look for a file named ‘log4j2.xml’.
You can run the SNMP Device Locator program from either the command prompt or from the Windows task scheduler. Instructions for both options are provided below.
To run via Windows Command Prompt:
There are three ways to run the SNMP device locator in cmd.
-
Run without argument. The program will prompt for input of the configuration folder path. Make sure the configuration file, log xml file, and the .exe file are saved in the same folder. If the files are not found, the program will prompt for input of their locations.
Open cmd and go the location of the Device locator and input the following:
>devicelocator
It will ask for the configuration folder location, please enter the configuration folder path.
The same flow above will also happen if the device locator .exe is opened to run the program.
-
Run the executable with configuration folder path as argument. The same as the first method but the configuration folder path is already provided as an argument. If the files are not found in the specified path, the program will end.
Example in cmd:
>devicelocator C:\Users\user\Desktop\
Where, C:\Users\user\Desktop\ is the location of the configuration file.
-
Run with two arguments, (1) the configuration file’s path and (2) the log XML file’s path. If the files are not found in the specified path, the program will end.
Example in cmd:
>devicelocator C:\Users\user\Desktop\devicelocator\devicelocatorconfig.csv C:\Users\user\Desktop\devicelocator\log4j2.xml
Where, C:\Users\user\Desktop\devicelocator\devicelocatorconfig.csv is the location of the configuration file and
C:\Users\user\Desktop\devicelocator\log4j2.xmlis the log XML.
Running the program with correct information creates log entries in the log properties named devicelocator.log. The information will also be output to the command line. The logs created depend on the logger level specified. It may be INFO (basic information) or DEBUG (detailed information).
To run via Windows Task Scheduler:
To setup a Device Locator task schedule using Windows, please follow the steps below:
-
Open the Windows Task Scheduler. This can be done by searching for “task scheduler” on the Start Menu.
-
Click Create a basic task.
-
Enter a name for the task.
-
Select the appropriate trigger for the basis on which you would like to schedule the program to run. You can also further specify the occurrence of the task.
-
In Action screen, select Start a program.
-
For Program/script, browse the location the executable file.
-
In the arguments column you can specify either the configuration folder path or the (1) the path of the configuration file and (2) the path of the log XML file.
-
Click [Next] and finish the device locator scheduled task.
To quickly check if the scheduled task completed successfully, open the Task Scheduler Library, and look for the Device Locator task. In the History tab, check for the latest Action completed, click the item, and check the General information. Return code 0 indicates that the program ran successfully.