NetXMS Support Forum

English Support => General Support => Topic started by: prutser on February 29, 2008, 12:27:55 PM

Title: Condition
Post by: prutser on February 29, 2008, 12:27:55 PM
Hello again,

Is it possible to keep a history of the results of a condition? It does not seem possible to create a DCI: Internal/child.status(condition)!
Is there a way to create such a history?

PS: I need the condition, because I need to calculate with results of the DCI's of different nodes.

Thanxx in advance!
Title: Re: Condition
Post by: Victor Kirhenshtein on March 01, 2008, 09:21:06 AM
Hello!

It's not possible now, but idea is good, so I will implement a special DCI for obtaining condition status.

Best regards,
Victor
Title: Re: Condition
Post by: prutser on March 03, 2008, 09:10:00 AM
Thank you very much for your answer.

In the meanwhile, suppose I create a mysql table myself, is there a way to use the NXSL (scripting) to do an insert into the table? (Eg, node_id, timestamp, condition value)? It would really help me out...

Thanxx in advance!
Title: Re: Condition
Post by: Victor Kirhenshtein on March 06, 2008, 09:49:13 AM
Hello!

It's not possible to access database from NXSL. Although it's not hard to implement this functionality, it potentially can be a big security hole. But you can expect ConditionStatus DCI in 0.2.20 :)

Best regards,
Victor
Title: Re: Condition
Post by: Victor Kirhenshtein on March 07, 2008, 12:40:40 PM
Hello!

ConditionStatus() DCI is available in 0.2.20-RC3. Please note that to use it you should add node on which you configure this DCI to condition's trusted nodes list, or disable trusted nodes checking by setting global server configuration parameter CheckTrustedNodes to 0.

Best regards,
Victor
Title: Re: Condition
Post by: prutser on March 10, 2008, 02:22:18 PM
Thank you very very much for your quick help. If people are interested, I'd like to share following info:
The core service failed to start on Windows 2003 after upgrading to the RC3. Solution for me was:

1. I checked the log-file (c:\netxms\log\setuplog.log) and got an error on 2 "empty" conditions (Value in SQL-yog was: #00 instead of <NULL>). (The conditions were created, but there was no data and script in it..) I'm not sure wether this was the reason for the windows service not starting up, because after removal of the empty conditions the service still didn't want to start...
2. Delete the core service:
    C:\NetXMS\bin>netxmsd -R
3. Recreate the service:
    C:\NetXMS\bin>netxmsd -c "C:\NetXMS\etc\netxmsd.conf" -I
    I'm not sure wether the "-c config-file" part is needed to create the service.
Afterwards, the service started normally...
I'm now trying to test the ConditionStatus(*)...

PS: this was the error in the log file:
[10-Mar-2008 11:43:35] Log file opened
[10-Mar-2008 11:43:35] Database driver "mysql.ddr" loaded and initialized successfully
[10-Mar-2008 11:43:39] GSM modem on COM1: initialized successfully. Hardware ID: "".
[10-Mar-2008 11:43:39] Failed to compile evaluation script for condition object 204 "CSTST_PRCS": Error in line 1: syntax error, unexpected $end
[10-Mar-2008 11:43:39] Failed to compile evaluation script for condition object 207 "CSPROD_PRCS": Error in line 1: syntax error, unexpected $end
[10-Mar-2008 11:43:39] Failed to compile evaluation script for condition object 211 "HRPROD_PRCS": Error in line 1: syntax error, unexpected $end
[10-Mar-2008 11:43:39] NetXMS Server started
[10-Mar-2008 11:43:39] NetXMS Server stopped
[10-Mar-2008 11:43:41] Log file closed
Title: Re: Condition
Post by: Victor Kirhenshtein on March 10, 2008, 04:40:40 PM
Hello!

Thanks for your post. I forgot to mention this upgrade problem :( The really needed steps is 2 and 3, and -c option is needed. This is because in 0.2.20 changes syntax of netxmsd.exe command line, to be in common style with agent and other tools.

Best regards,
Victor
Title: Re: Condition
Post by: prutser on March 11, 2008, 02:14:14 PM
 I 've been fiddling around with the conditions and condition.status(*) and it works like a charm.

What still might be a nice feature is that a condition could take another condition as a data-value (Now it can only take a host/dci). But I work around by using an intermediate DCI. (This takes an extra delay, but is not really a problem...)
Also thank you for the tip about the trusted nodes part, because I would never have figured that out! Apparently you get an "not supported" error then...  ;)