Database row count

Started by Ian, January 07, 2014, 10:03:29 AM

Previous topic - Next topic

Ian

Hello good day to all. Newbie here. Can I just ask if NetXMS has the capability to monitor the database row count? Thank you for this software and hope for continuous improvement.  :)

Victor Kirhenshtein

Hi!

Yes, you can use either ODBCquery or dbquery subagent to execute SQL queries periodically. ODBCquery subagent description is here: http://wiki.netxms.org/wiki/Subagent:ODBCQuery.

For DBquery, agent configuration file can be like this:


# standard stuff here ...
SubAgent = dbquery.nsm

*DBQUERY
Database = id=db1;driver=mysql.ddr;server=127.0.0.1;dbname=mydb;login=user;password=pass


Then to get number of records in table t1, you can use parameter

DB.Query(db1,"SELECT count(*) FROM t1")

Please note that DBquery is a new subagent intended to replace ODBCquery, but it's not 100% ready yet.

Best regards,
Victor

Ian

Thanks Victor for the quick reply. Will try it now :)