Default Script and Program Monitors
IPHost Network Monitor is capable of running external scripts and programs that calculate performance numbers and report them back to the monitoring service. You can create your own monitors of this type to perform specific tasks; you can also contact us at support@iphostmonitor.com if you would like this us to write such monitors for you as a separate project. However, several such monitors are shipped with the IPHost Network Monitor by default and you can utilize them as explaind below.
Usage: directory_size_kb.exe directory_name [-t timeout in sec] [-l DOMAIN:user:password]
Program Type: Run program
Program Mode: Standard
You pass UNC or local directory name as a first parameter to this program. By default, a timeout of 10 seconds is implied for the whole operation that you can override using the -t command line switch. The last switch, -l, is used to pass credentials of a user who has rights to access the directory. Since monitoring service runs under a Local System account, it may not access remote shared directories by default and it should present valid user credentials to access such shares.
Typical Program Parameters string for this script might look like:
\\URAN\public -l $AdminDomain:$AdminName:$AdminPassword
You can view source code of this plugin in scripts\iphost_dirsize_kb.cpp and build it using scripts\iphost_dirsize_kb.bat.
Usage: iphost_file_content.vbs <file> <mode> <string> [credentials]
Program Type: Run script
Program Mode: Standard
This monitor reads the file which name is passed as the first argument and searches for the particular string. It has two modes of execution:
- Mode is 'C' (count): the script counts total number of occurrences of string in file
- Mode is 'F' (find): the script searches for the first occurrence of string in file and returns the first number it finds afer this string.
Credentials string, if present, has the same format as for the directory size monitor: domain, user name, and password separated by colon. Since monitoring service runs under a Local System account, it may not access remote shared files by default and it should present valid user credentials to access such shares.
You can use this script say to study contents of log files. The script can return total number of particular messages or particular numeric value (that may be an error code). The following arguments instruct the script to return total number of IPHost Network Monitor Web interface shutdowns:
"C:\ProgramData\IPHost Network Monitor\logs\error.log" C shutdown
Usage: iphost_http_content.vbs <URL> <mode> <string>
Program Type: Run script
Program Mode: Standard
This monitor makes the HTTP(S) request to the particular URL passed as the first argument and searches for the particular string. It has two modes of execution:
- Mode is 'C' (count): the script counts total number of occurrences of string in HTTP response.
- Mode is 'F' (find): the script searches for the first occurrence of string in HTTP response and returns the first number it finds afer this string.
You can find many uses for this script. One funny example is weather monitoring. The following arguments instruct the script to return current weather in London:
"http://weather.yahooapis.com/forecastrss?p=UKXX0085&u=c" F temp=
To determine similar URL for your location, enter your city name at weather.yahoo.com, find and click the RSS subscription link and look at the resulting URL in browser navigation bar. Please don't schedule such HTTP requests too frequently; a polling interval of 3600 seconds (1 hour) should be enough in most cases.
