OpManager monitors all the system resources on servers: Windows servers are monitored using SNMP, WMI, or both and Unix servers are monitored using SNMP or CLI (Telnet or SSH). While most resources are monitored out-of-the-box, OpManager lets you add any number of custom monitors too. An intuitive web interface is provided for configuring SNMP and WMI-based custom monitors and the GUI is yet to be extended to CLI custom monitors. We often receive queries on creating custom CLI monitors for Linux, HP-UX, IBM AIX servers etc. While there is no simple direct way of doing this from the web interface, here is a workaround to create CLI-based custom monitors for the servers supporting CLI:

Example: Adding a custom Disk Partition monitor on an IBM-AIX server

Step1: Editing the HostResource.xml file
Step2: Editing the Device Template
Step3: Updating few Database tables
Step4: Adding the new custom monitor to the device

Step1: Editing the HostResource.xml file

1. Open the file OpManager\conf\application\HostResource.xml file in an editor.
2. Look for the entry where the  POLL ID is “IBM AIX”. The default monitors associated to the AIX devices is each specified under a <CATEGORY>.
3. Include one more CATEGORY tag and the sample snippet is below:

<CATEGORY ID=”DiskPartition” command=”/usr/bin/df -k” parseAll=”true” ignoreLines=”1″ description=”Percentage of space used
  in each partition on the disk.”>
        <ENTITY ID=”DiskPartition” applyThresholdOver=”partition” threshold=”Th6″ storeHistory=”true”  units=”%” storeValue=”partition” >
           <PARSE token=”7″ name=”partitionName” isEntityName=”true” />
           <PARSE token=”4″ name=”partition”>
              <OPTIONS ignoreCharsFrom=”%” />

4.Save the HostResource.xml file.

Note: The Unix commands and the output format may vary on some devices. Execute the command from the command line first and see the output format. The output lines and the token numbers may vary based on which you will need to replace the correct line and token number in the above entry. If you have trouble getting the parsing right, just execute the command from the prompt and send the screenshot with the output to opmanager-support@manageengine.com. We’ll assist you with the configuration.

Step2: Editing the Device Template

1.From Admin –> Device Templates, click on the IBM AIX template (or the template of the relevant Unix-based server).

2. In the template, click Add Monitors and in the screen that pops up, click Add Bulk.

3. In the Add Bulk Monitors screen, configure the following details and hit OK:

  • Monitor name as PartitionDetails
  • SNMP OID as  DiskPartition ( the name of the Category ID as configured in the HostResource.xml file).
  • Select the type as Numeric
  • Specify the interval at which you want the resource monitored (in minutes)
  • Unit as %
  • And threshold and re-arm value according to your need.

Adding Custom CLI Monitors

4.Click on the Modify button in the configuration screen and don’t apply the template yet.

Step3: Updating few Database tables

A few database changes need to be carried out to get the custom monitors working. Here is the detailed procedure:

1. Change directory on the command prompt to OpManager\mysql\bin path and connect to the (MySQL) database as follows:

 mysql.exe -u root -P 13306 OpManagerDB

Connecting to OpManager Database

2. Execute the following query to update the protocol ID

  update graphdetails set protocolid=2 where graphname like ‘PartitionDetails’;

where the protocol ID is a numeric ID of the supported monitoring protocols ( SNMP is 1, CLI is 2, WMI is 3)


3. Each resource is assigned a unique ‘graphid’. Make a note of the graphid assigned to the new custom monitor using the following query:

select graphid from graphdetails where graphname=’PartitionDetails’;

Make a note of the graphid . It is 599 in this example. You will now replace this ID in another table.

4.Execute the following queries to update/delete the graphID in a couple of tables:

i)delete from devicepackagetograph where graphid=599;

ii) delete from vendorgraphdetails where graphid=599;

iii) insert into standardgraphdetails values (3, 599);

iv) update graphdetails set graphtypeid=3 where graphid=599;

Step4: Adding the new custom monitor to the device

1. Restart OpManager service.

2. Go to the device snapshot page for which you want the monitor associated and add the monitor or apply the device template to all the devices for which you want the monitor added.

Agreed this procedure is quite roundabout, but it is the best workaround till we come up with a simple GUI:)  Am sure our Developers have heard the request too

Feel free to post your queries here or write to our technical support : opmanager-support@manageengine.com.

  1. Steve

    Can I do this on MSP ServiceDesk Plus, if so how?
    I try and update the opmanagerdb instance on the probe server and there is no graph details table.
    I try and update centraldb instance on central server and get:
    ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`centraldb/graphdetails`, CONSTRAINT `GraphDetails_FK2` FOREIGN KEY (`PROTOCOLID`) REFERENCES `protocoldetails` (`PROTOCOLID`) ON DELETE CASCADE)

    I really need to be able to do this, please help.