ManageEngine® Applications Manager


AddMonitor API - Custom Monitors

<< Prev

Home

Next >>

AddMonitor API - Custom Monitors

 

This section explains how to use the AddMonitor API to add monitors of the category type 'Custom Monitors'. The following monitors are supported:

Windows Performance Counters

Syntax:


http://[Host]:[Port]/AppManager/xml/AddMonitor?apikey=[APIKEY]&type=[TYPE]
&displayname=[DISPLAYNAME]&host=[HOST]&username=[USERNAME]&password=[PASSWORD]&pollinterval=[POLLINTERVAL]

 

Request Parameters:

The parameters involved in the API request are described below. Also, refer the list of common Request Parameters.


Field Description        
type The type of the monitor you want to add. Value should be Windows Performance Counters.
host The name of the host where the Windows Performance Counters is running.
username The user name of the host running Windows Performance Counters.
password The password of the host running Windows Performance Counters.
pollinterval The interval at which you want the polling to happen.

Sample Request:


http://app-xp4:9090/AppManager/xml/AddMonitor?apiey=ee8d8e237bd5e1a0d8aed16a381c3b73
&type=Windows Performance Counters&host=app-xpmll&displayname=hhhh&username=asasaa&password=vembu

Top

Database Query Monitor

Syntax:


http://[Host]:[Port]/AppManager/xml/AddMonitor?apikey=[APIKEY]&type=[TYPE]
&displayname=[DISPLAYNAME]&host=[HOST]&port=[PORT]&username=[USERNAME]&password=[PASSWORD]
&databasetype=[DATABASETYPE]&databasename=[DATABASENAME]&showqueryoutput=[SHOWQUERYOUTPUT]
&queries=[QUERIES]

 

Request Parameters:

The parameters involved in the API request are described below. Also, refer the list of common Request Parameters.


Field Description        
type The type of the monitor you want to add. Value should be QueryMonitor.
host The name of the host where the databae server is running.
port The port number where the database is running
username The user name of the database server .
password The password of the database server.
databasetype The database type for which the query is executed.
databasename The name of the database server.
showqueryoutput Option to specify whether you prefer query output. Values are yes and no
queries Denotes the database query. There can be a maximum of five queries.

 

 

Sample Request:


http://prod-server8:9090/AppManager/xml/AddMonitor?apikey=bbab7f01458e96595b06d5c27efcc3af
&type=QueryMonitor&displayname=qury&host=app-xp2&port=1433&username=sa&password=Advent1&databasetype=MsSQL&databasename=AMDB&showqueryoutput=yes&queries=select * from user

Top


File/Directory Monitor

Syntax:

 

http://[Host]:[Port]/AppManager/xml/AddMonitor?apikey=[APIKEY]&type=File Monitor&displayname=[DISPLAYNAME]&filepath=[FILEPATH]&serversite=[SERVERSITE]&pollinterval=[POLLINTERVAL]&timeout=[TIMEOUT]

 

Request Parameters:

The parameters involved in the API request are described below. Also, refer the list of common Request Parameters.


Field Description        
type The type of the monitor you want to add. Value should be File Monitor.
host The name of the host where the File Monitor is running.
type Specifies whether it is a File or Directory monitor.
serversite Specifies whether the File / Directory to be monitored is on the Local or Remote Server.
filepath The path to the file to be monitored
contentChk Specifies if you wish to run a content check. If Content check is to be performed then use contentChk=on
monitoringmode Specifies the Mode Of Monitoring (WMI for Windows, Telnet/SSH for Linux)

Sample Request:

 

For a Local File
http://prod-server8:9090/AppManager/xml/AddMonitor?apikey=bbab7f01458e96595b80f042db3eff62f0&type=File Monitor&displayname=test1&filepath=F:\LATEST\AppManager11\logs\stdout.txt&serversite=local&pollinterval=5&timeout=60

 

For a Remote File

http://prod-server8:9090/AppManager/xml/AddMonitor?apikey=1bbab7f01458e96595bb3eff62f0&type=File Monitor&displayname=test7&filepath=F:\LATEST\AppManager11\logs\stdout.txt&serversite=remote&pollinterval=5&timeout=60&choosehost=-1&monitoringmode=WMI&host=app-support-w7&username=administrator&password=Apmsupport1

 

For a Local File when Content Check is enabled

http://prod-server8:9090/AppManager/AppManager/xml/AddMonitor?apikey=945bbab7f01458e96595b795cd7&type=File Monitor&displayname=test2&filepath=d:\stdout.txt&serversite=local&pollinterval=5&timeout=60&contentChk=on®exChk=on&ccontent=a*b&fileCheckType=whole&selectStatusType=down&selectRuleType=all

 

For a Remote File when Content Check is enabled

http://prod-server8:9090/AppManager/xml/AddMonitor?apikey=6a3803a905cbbab7f01458e96595b856&type=File Monitor&displayname=test12&filepath=C:\Test\Grep.txt&serversite=remote&pollinterval=5&timeout=60&contentChk=on&ccontent=Exception&fileCheckType=whole&selectStatusType=down&selectRuleType=all&choosehost=-1&monitoringmode=WMI&host=app-xp2&username=asasaa&password=001

 

When both file/directory age check and content check are enabled

http://prod-server8:9090/AppManager//AppManager/xml/AddMonitor?apikey=1561056503f5164180f042db3eff62f0&type=File Monitor&displayname=test6&filepath=F:\LATEST\AppManager11\logs\stdout.txt&serversite=local&pollinterval=5&timeout=60&fileDirAge=yes&selectMonStatus=down&selectChangeType=notmodified&timeval=50&timeUnit=Minutes&contentChk=on&ccontent=test&fileCheckType=whole&selectStatusType=down&selectRuleType=any&countval=3

Top

 

Script Monitor

 

Syntax:

http://[Host]:[Port]/AppManager/xml/AddMonitor?apikey=[APIKEY]&type=[Script Monitor]&displayname=[DISPLAYNAME]&serverpath=[SERVERPATH]&workingdirectory=[FILEPATH]&serversite=[LOCAL/REMOTE]&pollinterval=[POLLINTERVAL]&timeout=[TIMEOUT]

 

Request Parameters:

The parameters involved in the API request are described below. Also, refer the list of common Request Parameters.


Field Description        
type The type of the monitor you want to add. Value should be Script Monitor.
host The name of the host where thescript monitor is running.
serversite Specifies whether the script to be monitored is on the Local or Remote Server.
filepath The path to the script file to be monitored
monitoringmode Specifies the Mode Of Monitoring (WMI for Windows, Telnet/SSH for Linux)

Sample Request:

 

For a local server:

http://prod-server8:9090/AppManager/xml/AddMonitor?apikey=1561056503f5164180f2db3eff62f0&type=Script Monitor&displayname=test1&serverpath=F:\AppManager11\bin\CkServerConnection.bat&workingdirectory=F:\Managed\AppManager11\bin\&serversite=local&pollinterval=5&timeout=30

 

For a remote server:

http://prod-server8:9090/AppManager/xml/AddMonitor?apikey=151056503f5164180f2db3b3eff62f0&type=Script Monitor&displayname=test2&serverpath=/home/likewise-open/ZOHOCORP/prodserver-9091/test.sh&workingdirectory=/home/ZOHOCORP/prodserver-9091&serversite=remote&pollinterval=5&timeout=60&choosehost=-1&monitoringmode=SSH&host=prodserver-9091&username=prodserver-9091&password=Zoho123&prompt=$port=22

 

With Output Settings enabled, (Give new line with %0A):

http://prod-server8:9090/AppManager/xml/AddMonitor?apikey=1561003f5164180f280f042db3eff62f0&type=Script Monitor&displayname=test3&serverpath=F:\AppManager11\bin\ChkServerConnection.bat&workingdirectory=F:\AppManager11\bin\&serversite=local&pollinterval=5&timeout=60&opfile=true&outputfile=F:\AppManager11\bin\result.txt&string_att=Name1,Name2&numeric_att=Age1,Age2&delimiter==

 

With the tables in output file enabled:

http://prod-server8:9090/AppManager/xml/AddMonitor?apikey=1561056503f5164180f042db3eff62f0&type=Script Monitor&displayname=test3&serverpath=F:\AppManager11\bin\ChkServerConnection.bat&workingdirectory=F:\AppManager11\bin\&serversite=local&pollinterval=5&timeout=60&opfile=true&outputfile=F:\AppManager11\bin\result.txt&string_att=Name1,Name2&numeric_att=Age1,Age2&delimiter==&tablespresent=on&table_row=1&table1=Test1&numericatt1=Num1&stringatt1=Str1&pcatt1=Num1&cdl1==

 

Top

<< Prev

Home

Next >>

AddMonitor API - Cloud Apps

AddMonitor API - Database Servers