NetXMS Support Forum

English Support => General Support => Topic started by: Egert143 on February 14, 2020, 07:18:03 PM

Title: Logging console 'sh sta'
Post by: Egert143 on February 14, 2020, 07:18:03 PM
Hello

Is it possible to log statistics shown in console 'sh sta'? For example poll them via dci script?
Title: Re: Logging console 'sh sta'
Post by: Borgso on February 16, 2020, 03:18:41 PM
You can run this command on server:
nxadm -c "sh sta"

Then use a ExternalParameter to extract the data you will keep track on.
Title: Re: Logging console 'sh sta'
Post by: Egert143 on February 16, 2020, 06:31:04 PM
Thanks for tip.

I went with following solution:

Agent conf:
Query = Alarms-Outstanding:db1:300:SELECT COUNT (alarm_state) as Alarms FROM [netxms_db].[dbo].[alarms] WHERE alarm_state = 0

Dci parameter: DB.QueryResult(Alarms-Outstanding)