Private/SIs/NoData_Metrics.xml
<?xml version="1.0" encoding="UTF-8" ?> <feed version="1.0" hasPendingRequests="false" > <company></company> <status>200</status> <errmsg>OK</errmsg> <interval>0</interval> <entry type="predatasource"> <version>1613141785</version> <name>NoData_Metrics</name> <displayedas>No Data Metrics</displayedas> <description>Returns counts of datapoints returning NaN vs Numeric values</description> <collector>script</collector> <hasMultiInstances>false</hasMultiInstances> <useWildValueAsUniqueIdentifier>false</useWildValueAsUniqueIdentifier> <schedule>60</schedule> <appliesTo>system.collectorId > 0</appliesTo> <wildcardauto>false</wildcardauto> <wildcardpersist>false</wildcardpersist> <wildcardlinuxscript></wildcardlinuxscript> <wildcardlinuxcmdline></wildcardlinuxcmdline> <wildcardwinscript></wildcardwinscript> <wildcardwincmdline></wildcardwincmdline> <wildcardgroovyscript></wildcardgroovyscript> <wildcardschedule>1440</wildcardschedule> <wildcarddisable>false</wildcarddisable> <wildcarddeleteinactive>false</wildcarddeleteinactive> <agdmethod>none</agdmethod> <agdparams></agdparams> <group>NoDataMonitoring</group> <tags></tags> <technology></technology> <adlist><![CDATA[{"agdmethod":"none","agdparams":"","id":0,"filters":[],"params":{}}]]></adlist> <schemaVersion>2</schemaVersion> <integrationMetadata> <integrationVersion>1.1.0</integrationVersion> <integrationAuthorCompanyUuid>5d1de56c-12dc-11e6-8dbd-0a8c30e38697</integrationAuthorCompanyUuid> <integrationLineageId>KEBpqRCzS3Kp72ke5ybq8g</integrationLineageId> <integrationChecksum>8580b7f71ea978a0fdb2a6260fa74e0f</integrationChecksum> <integrationAuthorNamespace>antony</integrationAuthorNamespace> <integrationId>c3e53c39-0757-4dd4-83db-fbc65b2542c6</integrationId> <integrationLocator>ZKTG2R</integrationLocator> <integrationName>NoData_Metrics</integrationName> <integrationStatus>Community</integrationStatus> <integrationPublishedAtMS>1613141864316</integrationPublishedAtMS> <integrationIsPrivate></integrationIsPrivate> </integrationMetadata> <dataSourceType>1</dataSourceType> <attributes> <attribute> <name>scripttype</name> <value>embed</value> <comment></comment> </attribute> <attribute> <name>scriptgroovy</name> <value>import com.santaba.agent.collector3.CollectorDb // Set debug=true to print debug outputs. Leave =false for normal operation. debug = false; def hostName = hostProps.get('system.hostname'); def hostId = hostProps.get('system.deviceId'); def CollectorId = hostProps.get('system.collectorid'); numberCount = 0; NaNCount = 0; complexCount = 0; allCount = 0; // This has interesting stuff and knows DS names associated with task ID allTasks = CollectorDb.getInstance().getTasks() allTasks.each { task -> def taskInfo = task.getTaskInfo(); if(taskInfo.toString().contains(hostName + ' (' + hostId + ')')) { debugPrinter('='*20); debugPrinter(task); try { lastValues = taskInfo.getCollectingHistory().getHistory().last().value lastValues.each { value -> debugPrinter('-'*20); debugPrinter(value); // DO NOT just increment allCount, as some failures of collection put spurious entries into // this .each loop. Honest. Trust me on this one. // First, see if the value is numeric. If it isn't, see whether it's NaN or a complex datapoint. // Anything else can be ignored. // Complex datapoints are only known to the collector as '-Infinity', as Santaba does the mathematics. try { isNumeric = value.toBigInteger(); debugPrinter(isNumeric); numberCount++; } catch(notNumeric) { debugPrinter(notNumeric); if(value.toString() == 'NaN') { NaNCount++; debugPrinter('NAN: ' + value); } if(value.toString() == '-Infinity') { complexCount++; debugPrinter('Complex: ' + value); } } } } catch(e) { debugPrinter(e); } } } allCount = numberCount + NaNCount + complexCount println 'allMetricsCount=' + allCount; println 'numericMetricsCount=' + numberCount; println 'NaNMetricsCount=' + NaNCount; println 'complexMetricsCount=' + complexCount; println 'CollectorId=' + CollectorId; return 0; // --------------------------------------------------------------------------------------- // Function to print debug outputs. def debugPrinter(text,override=false) { // Just prints debug text, if enabled. if(debug || override) { println 'DEBUG: ' + text; } } // ---------------------------------------------------------------------------------------</value> <comment></comment> </attribute> <attribute> <name>windowsscript</name> <value></value> <comment></comment> </attribute> <attribute> <name>linuxscript</name> <value></value> <comment></comment> </attribute> <attribute> <name>windowscmdline</name> <value></value> <comment></comment> </attribute> <attribute> <name>linuxcmdline</name> <value></value> <comment></comment> </attribute> </attributes> <datapoints> <datapoint> <name>CollectorId</name> <originId>fdyBr8QJSHipSz3HnV30nA</originId> <dataType>7</dataType> <type>2</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>CollectorId</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <enableanomalyalertsuppression></enableanomalyalertsuppression> <adadvsettingenabled>false</adadvsettingenabled> <warnadadvsetting></warnadadvsetting> <erroradadvsetting></erroradadvsetting> <criticaladadvsetting></criticaladadvsetting> <description>Recorded and returned such that jumps in NaN counts as a result of collector reassignment are easy to spot.</description> <maxvalue></maxvalue> <minvalue></minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>NaNMetricsCount</name> <originId>1oZ7K_CuSUqytvWScikQsg</originId> <dataType>7</dataType> <type>2</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>NaNMetricsCount</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <enableanomalyalertsuppression></enableanomalyalertsuppression> <adadvsettingenabled>false</adadvsettingenabled> <warnadadvsetting></warnadadvsetting> <erroradadvsetting></erroradadvsetting> <criticaladadvsetting></criticaladadvsetting> <description>Count of datapoints returning NaN</description> <maxvalue></maxvalue> <minvalue></minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>allMetricsCount</name> <originId>_VoWIlGhRuKtPoUu86X14w</originId> <dataType>7</dataType> <type>2</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>allMetricsCount</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <enableanomalyalertsuppression></enableanomalyalertsuppression> <adadvsettingenabled>false</adadvsettingenabled> <warnadadvsetting></warnadadvsetting> <erroradadvsetting></erroradadvsetting> <criticaladadvsetting></criticaladadvsetting> <description>Total count of datapoints on resource</description> <maxvalue></maxvalue> <minvalue></minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>complexMetricsCount</name> <originId>l3nM9yrkTGazi3Sto3KpOQ</originId> <dataType>7</dataType> <type>2</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>complexMetricsCount</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <enableanomalyalertsuppression></enableanomalyalertsuppression> <adadvsettingenabled>false</adadvsettingenabled> <warnadadvsetting></warnadadvsetting> <erroradadvsetting></erroradadvsetting> <criticaladadvsetting></criticaladadvsetting> <description>Count of complex datapoints on resource</description> <maxvalue></maxvalue> <minvalue></minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>numericMetricsCount</name> <originId>8tq2hoNiSYevdaBqVvi7UA</originId> <dataType>7</dataType> <type>2</type> <postprocessormethod>namevalue</postprocessormethod> <postprocessorparam>numericMetricsCount</postprocessorparam> <usevalue>output</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <enableanomalyalertsuppression></enableanomalyalertsuppression> <adadvsettingenabled>false</adadvsettingenabled> <warnadadvsetting></warnadadvsetting> <erroradadvsetting></erroradadvsetting> <criticaladadvsetting></criticaladadvsetting> <description>Count of metrics returning numeric values.</description> <maxvalue></maxvalue> <minvalue></minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> <datapoint> <name>scriptTime</name> <originId>ZqfCtuQ0QS2k6OSNzcG0cg</originId> <dataType>4</dataType> <type>2</type> <postprocessormethod>none</postprocessormethod> <postprocessorparam></postprocessorparam> <usevalue>responseTime</usevalue> <alertexpr></alertexpr> <alertmissing>1</alertmissing> <alertsubject></alertsubject> <alertbody></alertbody> <enableanomalyalertsuppression></enableanomalyalertsuppression> <adadvsettingenabled>false</adadvsettingenabled> <warnadadvsetting></warnadadvsetting> <erroradadvsetting></erroradadvsetting> <criticaladadvsetting></criticaladadvsetting> <description></description> <maxvalue></maxvalue> <minvalue></minvalue> <userparam1></userparam1> <userparam2></userparam2> <userparam3></userparam3> <iscomposite>false</iscomposite> <rpn></rpn> <alertTransitionIval>0</alertTransitionIval> <alertClearTransitionIval>0</alertClearTransitionIval> </datapoint> </datapoints> <graphs> <graph> <name>Collector Id</name> <title>Collector Id</title> <originId>WmHwYsQWQOu0Az9B6I8bfg</originId> <verticallabel>ID</verticallabel> <rigid>false</rigid> <maxvalue>NaN</maxvalue> <minvalue>0.0</minvalue> <displayprio>6</displayprio> <timescale>1day</timescale> <base1024>false</base1024> <graphdatapoints> <graphdatapoint> <name>CollectorId</name> <datapointname>CollectorId</datapointname> <originId>bH1PV_rYSR2jAvhm31LPPg</originId> <cf>1</cf> </graphdatapoint> </graphdatapoints> <graphvirtualdatapoints> </graphvirtualdatapoints> <graphdatas> <graphdata> <type>1</type> <legend>CollectorId</legend> <color>fuchsia</color> <datapointname>CollectorId</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> </graphdatas> </graph> <graph> <name>Metrics</name> <title>Metrics</title> <originId>n1vl13vXQPOLopcUk2TR7A</originId> <verticallabel>count</verticallabel> <rigid>false</rigid> <maxvalue>NaN</maxvalue> <minvalue>0.0</minvalue> <displayprio>1</displayprio> <timescale>1day</timescale> <base1024>false</base1024> <graphdatapoints> <graphdatapoint> <name>allMetricsCount</name> <datapointname>allMetricsCount</datapointname> <originId>LJXFuYnKTDuzpCKdGQ-ljA</originId> <cf>1</cf> </graphdatapoint> <graphdatapoint> <name>complexMetricsCount</name> <datapointname>complexMetricsCount</datapointname> <originId>xFtB8gPURz2mX-736kR0MA</originId> <cf>1</cf> </graphdatapoint> <graphdatapoint> <name>NaNMetricsCount</name> <datapointname>NaNMetricsCount</datapointname> <originId>et96NMyOSFK0TxHb83fAwg</originId> <cf>1</cf> </graphdatapoint> <graphdatapoint> <name>numericMetricsCount</name> <datapointname>numericMetricsCount</datapointname> <originId>kQcvEftLQHu2nHFLHxy59w</originId> <cf>1</cf> </graphdatapoint> </graphdatapoints> <graphvirtualdatapoints> </graphvirtualdatapoints> <graphdatas> <graphdata> <type>3</type> <legend>NaNMetricsCount</legend> <color>red</color> <datapointname>NaNMetricsCount</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> <graphdata> <type>1</type> <legend>allMetricsCount</legend> <color>aqua</color> <datapointname>allMetricsCount</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> <graphdata> <type>3</type> <legend>complexMetricsCount</legend> <color>gray</color> <datapointname>complexMetricsCount</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> <graphdata> <type>3</type> <legend>numericMetricsCount</legend> <color>olive</color> <datapointname>numericMetricsCount</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> </graphdatas> </graph> <graph> <name>Script Time</name> <title>Script Time</title> <originId>xNbF1bA6QA6dcLbiZ_J42Q</originId> <verticallabel>ms</verticallabel> <rigid>false</rigid> <maxvalue>NaN</maxvalue> <minvalue>0.0</minvalue> <displayprio>4</displayprio> <timescale>1day</timescale> <base1024>false</base1024> <graphdatapoints> <graphdatapoint> <name>scriptTime</name> <datapointname>scriptTime</datapointname> <originId>XTXMudOURGewBu53sWeAmA</originId> <cf>1</cf> </graphdatapoint> </graphdatapoints> <graphvirtualdatapoints> </graphvirtualdatapoints> <graphdatas> <graphdata> <type>1</type> <legend>scriptTime</legend> <color>silver</color> <datapointname>scriptTime</datapointname> <isvirtualdatapoint>false</isvirtualdatapoint> </graphdata> </graphdatas> </graph> </graphs> <overviewgraphs> </overviewgraphs> <scripts> </scripts> </entry> </feed> |