@user55116 said in Help: Count Specific Value in DCI Table Column and Graph it:
Instead of using your script within the transformation section, why not create a DCI, which executes your script?
This way, you can use the default method for history and graphing from NetXMS.
Thanks for your answer. And yes, I did it yesterday and it worked.
I created first this script with the function count, so I can reuse it:
sub CALL_ACTIVE_COUNT(CALL_ACTIVE_TABLE,CALL_ACTIVE_PEER_ID,CALL_TYPE_ID)
{
COUNT=0;
for(i = 0; i < CALL_ACTIVE_TABLE->rowCount; i++)
{
if (CALL_ACTIVE_TABLE->get(i,CALL_ACTIVE_TABLE->getColumnIndex(CALL_ACTIVE_PEER_ID))==CALL_TYPE_ID)
{
COUNT=COUNT+1;
}
}
return COUNT;
}
Then I created this script as source for the DCI Configuration of my node, and thats is how I could obtain performance graphs:
use CUBE_CALL_ACTIVE_COUNT;
sub main()
{
LOCAL_ACTIVE_CALLS=CALL_ACTIVE_COUNT(GetDCIValue($node,FindDCIByDescription($node, "CALL-ACTIVE-TABLE-1")),"CALL-ACTIVE-PEER-ID",5);
return LOCAL_ACTIVE_CALLS;
}