Hi Victor. Thanks, I'll try doing that. I've turned on deadlock logging also, so hopefully I can capture something.
Regards,
Richard
Regards,
Richard
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
Database Table In_use Name_locked
--------------------------------------------------------
netxms_db idata_12102 2 0
sub main()
{
array inValues;
array outValues;
collectionPeriod = 24 * 60 * 60;
// Calculate the DCI name dynamically based on the name of the DCI object calling us.
// $dci->name should be formatted "<sometext>: <interfacename>" (the ": " is important and must be unique).
InputPrefix = "Input Bandwidth (bps) on ";
OutputPrefix = "Output Bandwidth (bps) on ";
WANname = "";
if (index($dci->name, ": ") > 0)
WANname = substr($dci->name, index($dci->name, ": ") + 2);
// Get DCI's for input/output
inDCIid = FindDCIByDescription($node, InputPrefix . WANname);
outDCIid = FindDCIByDescription($node, OutputPrefix . WANname);
// If DCI ID was determined, obtain array of all values for the past "collectionPeriod" seconds
if (inDCIid > 0)
inValues = GetDCIValues($node, inDCIid, time() - collectionPeriod, time());
if (outDCIid > 0)
outValues = GetDCIValues($node, outDCIid, time() - collectionPeriod, time());
// Get the 95th percentile reading for each array
in95th = calc95th(inValues);
out95th = calc95th(outValues);
// Utilisation is the max of any of the calculated 95th percentile values
utilisation = max((in95th != null ? in95th : 0),
(out95th != null ? out95th : 0));
return utilisation;
}