Database row count
-
-
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=passThen 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 -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login