SQL Database query for OpManager

SQL Database query for OpManager

SQL Database query for OpManager

Database queries can be run from the web UI to pull various information from the database. In addition, Manage Engine may provide queries and request the output when troubleshooting an issue.

To run a query, click the 'Support Icon' in the upper right corner:


Click the 'DB Query' button:



Below are a couple of searches that can be performed

Checking Engine ID of devices

OpManager had an issue with timing out the monitors, but it was successful using the MIB Browser and the Monitors would work after sending a get from the MIB Browser

 To check if the device EngineID seems to be changed when the test fails in OpManager. When the device is added to OpManager using SNMPV3 we will update the device engineid to 2 tables (Enginetable, usmtable)

select * from Enginetable

select * from usmtable

If the device EngineID is changed in the device and still the old EngineID is listed in OpManager we will face this issue. We need to make sure that EngineID in the device and the one configured in OpManager is same when test fails. 

Check for devices in NCM

We received the below inquiry from one of our clients. OpManager tries to log in with “root” credentials to the routers and switches when new ones come on line. This was observed this morning in the logs when I brought isfancabrtr1 online:

*Sep 26 10:40:47: %SEC_LOGIN-4-LOGIN_FAILED: Login failed
[user: root] [Source: 10.208.48.12] [localport: 22] [Reason: Login
Authentication Failed] at 10:40:47 arizona Wed Sep 26 2018

Router is added to NCM module of OpManager. NCM uses CLI to connect to Network Devices for backup operations and may be attempting this with root credentials or root user. 


To see if the device is listed or discovered in NCM use the SQL query against the Probe and check if the device is listed in the output

select * from ncmresource

Search for Serial and FW Version

SELECT DISPLAYNAME,IPADDRESS, DNSNAME, HI.HW_MANUFACTURER, HW_MODEL, HW_SERIALNUMBER, HW_OSVERSION, to_timestamp(ADDED_TIME/1000) as DiscoveredTime, LAST_UPDATED_TIME FROM HardwareInformation HI JOIN ManagedObject mo ON HI.MOID=mo.MOID JOIN OpMDeviceDetails OD ON mo.MOID=OD.MOID JOIN TopoObject tobj ON tObj.NAME=mo.NAME JOIN NODE node ON node.NAME=mo.NAME WHERE ISNODE='true'

 

Discovery Date And Time By Device And Ip Address


SELECT DISPLAYNAME, to_timestamp(ADDED_TIME/1000), IPADDRESS FROM OpMDeviceDetails OD JOIN ManagedObject mo ON OD.MOID=mo.MOID JOIN TopoObject tobj ON tObj.NAME=mo.NAME WHERE ISNODE='true'

TO SEE THE NEXT POLLING EVENT

For polling to work 'ACTIVE' must show true for monitors. If unmanaged ACTIVE will be false

select to_timestamp(timeval/1000), period, name, ACTIVE from PolledData where agent='pccsarrut1.dn.srp.gov.10000000001'
select to_timestamp(timeval/1000), period, name, ACTIVE from PolledData where agent='DEVICE NAME.PROBE ID'
Get the device name and probe id from the Snapshot page URL
 select * from hardwareinformation hw inner join managedobject mo on mo.moid=hw.moid




    • Related Articles

    • Accessing OpManager PGSQL Database

      Accessing the Database · Although uncommon, accessing the OpManager database may be required to pull specific data, apply changes, or to troubleshoot an issue as directed by Manage Engine. · To access the Central database, navigate to the following ...
    • Re-Index OpManager Postgres Database

      Query to check table size Reach out to Manage Engine prior to proceeding with any changes to the database. All queries must be run as the 'admin' user. Log into the server GUI and go to the database lookup page "Support>DB Query". Execute the ...
    • Opmanager is attempting to contact Zoho Networks and SMTP

      Introduction A customer noted that the OpManager Probe server was attempting to send data to Manage Engine which was in violation of the Firewall rules that they had on their IP network. Settings that may need to be changed to stop automated data ...
    • OpManager Trap Processor Config

      OpManager Trap Processor Config Trap processor can be edited to display a number of labels and information based on the markup language and variables (VarBinds) https://pitstop.manageengine.com/portal/kb/articles/how-to-configure-trap-message Changes ...
    • Configuring configlets in OpManager NCM

      Manage Engine has written instruction on using and creating configlets. The link in this KB may be changed if Manage Engine update it, but for now it is a source for other NCM info as well ...