ContributionsMost RecentMost LikesSolutionsDo you have datasources of top 10 cpu utilization ? Do you have datasources of top 10 cpu utilization for Windows and Linux servers in LogicMonitor Repository? Re: invalid Output format - root element of output JSON should be "data" I was worng to use BatchScript and Script. It worked by Script not BatchScript. Thanks, Kiyoshi invalid Output format - root element of output JSON should be "data" What does means the below message on the following setting ? [MSG] [WARN] [collector-task-thread-collector.batchscript-batchscript-28-1::collector.batchscript:Task:4218:XXX.XXX.XXX.XXX:batchscript:SAP Cloud Connector Memory Status::18] [BatchScriptSlaveTask._prepareOutput:155] invalid Output format - root element of output JSON should be "data", CONTEXT= The output is {"physicalKB":{"total":16469532,"CloudConnector":959296,"others":6477020,"free":9033216},"virtualKB":{"total":41635356,"CloudConnector":4639480,"others":5910204,"free":31085672},"cloudConnectorHeapKB":{"total":4128768,"used":209168,"free":3919600},"version":1} Re: java.lang.NullPointerException on Groovy Collector Attribute script It’s cleaner and more direct. It leads “exception:Cannot cast object '8433' with class 'java.lang.String' to class 'java.lang.Integer'”. Re: SAP HANA Connection Error The proxy settings is as following. Set actual dbname into the property:hana.<dbname>.url Set proxy into jdbc string: jdbc:sap://<host name>:<port>/?proxyHostname=<proxy host>&proxyPort=<proxy port>&proxyHttp=TRUE Thanks Kiyoshi Re: java.lang.NullPointerException on Groovy Collector Attribute script I resolved NullPointerException with httpClient = HTTP.open(hostname, Integer.parseInt(port), true); Thank you Kiyoshi java.lang.NullPointerException on Groovy Collector Attribute script The following script encounter NullPointerException. It seems hostProps.get() doesn’t work. Any advice will be appreciate. import com.santaba.agent.groovyapi.expect.Expect; import com.santaba.agent.groovyapi.snmp.Snmp; import com.santaba.agent.groovyapi.http.*; import com.santaba.agent.groovyapi.jmx.*; import org.xbill.DNS.*; Boolean debug = true String hostname = hostProps.get("system.hostname") ; String user = hostProps.get("scc.user"); String pass = hostProps.get("scc.pass"); String port = (String)hostProps.get("scc.port"); httpClient = HTTP.open(hostname, port, true); httpClient.setAuthentication(user,pass); //url="https://"+hostname+"/exposed?action=ping"; url="https://" + hostname + ":" + port + "/api/monitoring/memory"; //url="https://"+hostname+"/api/monitoring/performance/backends"; def getResponse=httpClient.get(url, ["Accept":"application/json"]); if ( !(httpClient.getStatusCode() =~ /200/) ) { httpClient.close(); return 1 } println httpClient.getResponseBody(); httpClient.close(); return 0; Re: SAP HANA Connection Error I set proxy properties to hana.dbnames.url as "HANA.DBNAMES.URL": "jdbc:sap://XXXXXXXXXX.hana.prod-jp10.hanacloud.ondemand.com:443/?proxyHostname=XXXXXXXXXX&proxyPort=8080&proxyHttp=true". SAP_HANA_Connections script test makes error like as “EXCEPTION=java.io.IOException: winproxy return status=0x80041010 errmsg=無効なクラスです”. How can I resolve proxy issue ? ------------ </entry>, script={"scriptgroovy":"/*******************************************************************************\n * ? 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\ndef modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\ndef emit = modLoader.load(\"lm.emit\", \"0\")\ndef lmSql = modLoader.load(\"lm.sql\", \"0\")\ndef lmDebug = modLoader.load(\"lm.debug\", \"0\")\nString dbnames = hostProps.get(\"hana.dbnames\") ?: hostProps.get(\"auto.hana.dbnames\") ?: \"\"\nBoolean debug = false\nBoolean connectionFailed = false\n\ndef connectionQuery = \"\"\"\nSELECT Top 10 CLIENT_HOST ,\n USER_NAME \n FROM (\nSELECT CLIENT_HOST ,\n USER_NAME ,\n COUNT(*) AS CONNECTION_COUNT,\n SUM(FETCHED_RECORD_COUNT) AS FETCHED_RECORD_COUNT,\n SUM(AFFECTED_RECORD_COUNT) as AFFECTED_RECORD_COUNT,\n SUM(SENT_MESSAGE_SIZE)AS SENT_MESSAGE_SIZE,\n SUM(SENT_MESSAGE_COUNT)AS SENT_MESSAGE_COUNT,\n SUM(RECEIVED_MESSAGE_SIZE) AS RECEIVED_MESSAGE_SIZE,\n SUM(RECEIVED_MESSAGE_COUNT) AS RECEIVED_MESSAGE_COUNT \nFROM SYS.M_CONNECTIONS\nWHERE SECONDS_BETWEEN(COALESCE(END_TIME, CURRENT_TIMESTAMP), CURRENT_TIMESTAMP) <= 900\nAND CREATED_BY = 'Session'\nGROUP BY Client_Host,\n Client_IP,\n USER_NAME \n)\nORDER BY CONNECTION_COUNT DESC\"\"\"\n\nif (dbnames)\n{\n dbnames.toString().tokenize(\",\").each { instanceName ->\n lmDebug.LMDebugPrint(\"\\tInstance Name ${instanceName}\", debug)\n String url = hostProps.get(\"hana.${instanceName.trim()}.url\") ?: hostProps.get(\"auto.hana.${instanceName.trim()}.url\")\n //if manually set username then over-ride the hostprops username\n String username = hostProps.get(\"hana.${instanceName.trim()}.url\") ?: hostProps.get(\"hana.user\") ?: \"\"\n String password = hostProps.get(\"hana.${instanceName.trim()}.pass\") ?: hostProps.get(\"hana.pass\") ?: \"\"\n def conn = lmSql.attemptConnection(username, password, url)\n if (conn.status == \"success\")\n {\n def connectionData = lmSql.runQuery(connectionQuery, conn.connection)\n lmDebug.LMDebugPrint(\"\\tConnection Data ${connectionData}\", debug)\n if (connectionData.status == \"success\")\n {\n connectionData.data.each\n { connUser ->\n emit.instance(\"${instanceName}||${connUser.CLIENT_HOST}||${connUser.USER_NAME}\",\"${instanceName} - ${connUser.CLIENT_HOST} - ${connUser.USER_NAME}\",[\"HOST\":connUser.CLIENT_HOST, \"USER_NAME\":connUser.USER_NAME, \"DBNAME\":instanceName])\n }\n conn.connection.close()\n }\n }\n else\n {\n connectionFailed = true\n lmDebug.LMDebugPrint(\"Failed to connect to ${url}\", debug)\n }\n }\n if (connectionFailed)\n {\n println(\"Failed to connect to database.\")\n return 1\n }\n}\n\nelse\n{\n println \"No database names defined in auto.hana.dbnames device property.\"\n return 1\n}\nreturn 0","linuxscript":"","linuxcmdline":"","windowscmdline":"","windowsscript":"","type":"embed"}, module=autodiscovery [2023-08-07 16:04:43.100 JST] [MSG] [INFO] [PollNow-38-2::testscript:Test:autodiscovery:embed:XXXXXXXXXX.hana.prod-jp10.hanacloud.ondemand.com:1691979504] [PollNowScriptExecutor.execute:90] Start to execute the poll now test script, CONTEXT=host=XXXXXXXXXX.hana.prod-jp10.hanacloud.ondemand.com, timeout=50, type=embed, argument=, scriptName= [2023-08-07 16:04:43.204 JST] [MSG] [ERROR] [PollNow-38-2::testscript:Test:autodiscovery:embed:XXXXXXXXXX.hana.prod-jp10.hanacloud.ondemand.com:1691979504] [PollNowTask.run:69] Fail to handle the poll now request feed, CONTEXT=type=4, feed={ "module": "autodiscovery", "extra": { "sourceName": "SAP_HANA_Connections", "collector": "ad_script" }, "host": { "hostname": "XXXXXXXXXX.hana.prod-jp10.hanacloud.ondemand.com", "dsis": [{ "wildvalue2": "", "name": "SAP_HANA_Connections", "datasourceid": 0, "wildvalue": "", "id": 0, "wildalias": "", "properties": {} }], "adlist": [], "hostid": 98, "properties": { "SYSTEM.CATEGORIES": "HANA_Cloud", "AUTO.LM.LAST_CHECK_TIME": "Mon Aug 07 03:00:41 JST 2023", "SYSTEM.HOSTSTATUS": "normal", "SYSTEM.COLLECTORVERSION": "34200", "SYSTEM.DB.ORACLE": "", "AUTO.NETWORK.NAMES": "XXXXXXXXXX.hana.prod-jp10.hanacloud.ondemand.com,XXXXXXXXXX.hana.prod-jp10.hanacloud.ondemand.com", "HANA.DBNAMES.URL": "jdbc:sap://XXXXXXXXXX.hana.prod-jp10.hanacloud.ondemand.com:443/?proxyHostname=XXXXXXXXXX&proxyPort=8080&proxyHttp=true", "HANA.DBNAMES": "H00", "SYSTEM.PREFCOLLECTORDESC": "WIN2016TEST1", "SYSTEM.DEVICEGROUPID": "15,14,115", "SYSTEM.DEVICEID": "98", "SYSTEM.EC2.REGION": "", "SYSTEM.COLLECTORID": "3", "SYSTEM.DISPLAYNAME": "Takabayashi_test", "HANA.USER": "LM_USER", "SYSTEM.NETSCANINFO": "", "SYSTEM.RESOURCECREATEDON": "1690876762", "SYSTEM.GROUPS": "Minimal Monitoring,Devices by Type/Misc,G1NEXT_Customizing", "SYSTEM.DB.MSSQL": "", "SYSTEM.WORKGROUP": "", "SYSTEM.CREDENTIAL.ID": "", "SYSTEM.SYSINFO": "", "SYSTEM.TOTALPHYSICALMEMORY": "", "SYSTEM.MODEL": "", "SYSTEM.EC2.RESOURCEID": "", "SYSTEM.DEVICETYPE": "0", "SYSTEM.HOSTNAME": "XXXXXXXXXX.hana.prod-jp10.hanacloud.ondemand.com", "SYSTEM.COLLECTORPLATFORM": "windows", "SYSTEM.ENABLENETFLOW": "false", "SYSTEM.VERSION": "", "NETAPP.SSL": "true", "SYSTEM.SYSOID": "", "SYSTEM.DEVICE.PROVIDER": "Regular", "SYSTEM.SYSNAME": "", "SYSTEM.DESCRIPTION": "", "AUTO.LM.AGE": "5.4175810185", "SYSTEM.PREFCOLLECTORID": "3", "SYSTEM.SYSTEMTYPE": "", "SYSTEM.COLLECTOR": "false", "AUTO.NETWORK.RESOLVES": "true", "SYSTEM.VENDOR": "", "SYSTEM.SYSIPS": "", "HANA.PORT": "443", "SYSTEM.DB.DB2": "", "SYSTEM.DB.MYSQL": "", "SYSTEM.COLLECTORDESC": "WIN2016TEST1", "SYSTEM.DOMAIN": "", "SYSTEM.STATICGROUPS": "G1NEXT_Customizing", "SYSTEM.CPU": "", "SYSTEM.IPS": "XXX.XXX.XXX.XXX,XXX.XXX.XXX.XXX", "SYSTEM.VIRTUALIZATION": "", "HANA.PASS": "****", "SYSTEM.MEMORY": "" } }, "script": { "scriptgroovy": "/*******************************************************************************\n * ? 2007-2022 - LogicMonitor, Inc. All rights reserved.\n ******************************************************************************/\ndef modLoader = new GroovyShell(getBinding()).parse(com.logicmonitor.mod.Snippets.getLoader())\ndef emit = modLoader.load(\"lm.emit\", \"0\")\ndef lmSql = modLoader.load(\"lm.sql\", \"0\")\ndef lmDebug = modLoader.load(\"lm.debug\", \"0\")\nString dbnames = hostProps.get(\"hana.dbnames\") ?: hostProps.get(\"auto.hana.dbnames\") ?: \"\"\nBoolean debug = false\nBoolean connectionFailed = false\n\ndef connectionQuery = \"\"\"\nSELECT Top 10 CLIENT_HOST ,\n USER_NAME \n FROM (\nSELECT CLIENT_HOST ,\n USER_NAME ,\n COUNT(*) AS CONNECTION_COUNT,\n SUM(FETCHED_RECORD_COUNT) AS FETCHED_RECORD_COUNT,\n SUM(AFFECTED_RECORD_COUNT) as AFFECTED_RECORD_COUNT,\n SUM(SENT_MESSAGE_SIZE)AS SENT_MESSAGE_SIZE,\n SUM(SENT_MESSAGE_COUNT)AS SENT_MESSAGE_COUNT,\n SUM(RECEIVED_MESSAGE_SIZE) AS RECEIVED_MESSAGE_SIZE,\n SUM(RECEIVED_MESSAGE_COUNT) AS RECEIVED_MESSAGE_COUNT \nFROM SYS.M_CONNECTIONS\nWHERE SECONDS_BETWEEN(COALESCE(END_TIME, CURRENT_TIMESTAMP), CURRENT_TIMESTAMP) <= 900\nAND CREATED_BY = 'Session'\nGROUP BY Client_Host,\n Client_IP,\n USER_NAME \n)\nORDER BY CONNECTION_COUNT DESC\"\"\"\n\nif (dbnames)\n{\n dbnames.toString().tokenize(\",\").each { instanceName ->\n lmDebug.LMDebugPrint(\"\\tInstance Name ${instanceName}\", debug)\n String url = hostProps.get(\"hana.${instanceName.trim()}.url\") ?: hostProps.get(\"auto.hana.${instanceName.trim()}.url\")\n //if manually set username then over-ride the hostprops username\n String username = hostProps.get(\"hana.${instanceName.trim()}.url\") ?: hostProps.get(\"hana.user\") ?: \"\"\n String password = hostProps.get(\"hana.${instanceName.trim()}.pass\") ?: hostProps.get(\"hana.pass\") ?: \"\"\n def conn = lmSql.attemptConnection(username, password, url)\n if (conn.status == \"success\")\n {\n def connectionData = lmSql.runQuery(connectionQuery, conn.connection)\n lmDebug.LMDebugPrint(\"\\tConnection Data ${connectionData}\", debug)\n if (connectionData.status == \"success\")\n {\n connectionData.data.each\n { connUser ->\n emit.instance(\"${instanceName}||${connUser.CLIENT_HOST}||${connUser.USER_NAME}\",\"${instanceName} - ${connUser.CLIENT_HOST} - ${connUser.USER_NAME}\",[\"HOST\":connUser.CLIENT_HOST, \"USER_NAME\":connUser.USER_NAME, \"DBNAME\":instanceName])\n }\n conn.connection.close()\n }\n }\n else\n {\n connectionFailed = true\n lmDebug.LMDebugPrint(\"Failed to connect to ${url}\", debug)\n }\n }\n if (connectionFailed)\n {\n println(\"Failed to connect to database.\")\n return 1\n }\n}\n\nelse\n{\n println \"No database names defined in auto.hana.dbnames device property.\"\n return 1\n}\nreturn 0", "linuxscript": "", "linuxcmdline": "", "windowscmdline": "", "windowsscript": "", "type": "embed" } }, EXCEPTION=The script returned non-zero exit code - 1 ------------ output ------------- Failed to connect to database. status=8, errCode=-1, message=The script returned non-zero exit code - 1 ------------ output ------------- Failed to connect to database. at com.santaba.agent.handlers.pollnow.testScript.ScriptOutput._mustBeZero(ScriptOutput.java:66) at com.santaba.agent.handlers.pollnow.testScript.ScriptOutput._verifyExitCode(ScriptOutput.java:52) at com.santaba.agent.handlers.pollnow.testScript.ScriptOutput.toJSON(ScriptOutput.java:37) at com.santaba.agent.handlers.pollnow.TestScriptPollNow._handle(TestScriptPollNow.java:153) at com.santaba.agent.handlers.pollnow.PollNowTask.run(PollNowTask.java:64) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [2023-08-07 16:04:43.204 JST] [MSG] [INFO] [PollNow-38-2::testscript:Test:autodiscovery:embed:XXXXXXXXXX.hana.prod-jp10.hanacloud.ondemand.com:1691979504] [PollNowManager.report:90] Try to report the poll now result, CONTEXT=id=1691979504, status=5, message=The script returned non-zero exit code - 1 ------------ output ------------- Failed to connect to database. , diagnose=, items={}, timestamp=1691391883202 [2023-08-07 16:04:44.039 JST] [MSG] [WARN] [collector-discover-thread-4-2::discover:adtask:16913918379540010:ad_wmi:Windows DNS Server-] [WinProxyStub.wmiQuery2:751] WinProxyStub.wmiquery, CONTEXT=Failed (host=127.0.0.1, Username=, Password=****, query=SELECT * FROM win32_perfrawdata_dns_dns, type=1) [0x80041010]: 無効なクラスです [2023-08-07 16:04:44.039 JST] [MSG] [ERROR] [collector-discover-thread-4-2::discover:adtask:16913918379540010:ad_wmi:Windows DNS Server-] [WMIDiscoveryTask._run:173] WMIDiscoveryTask._run, CONTEXT=hostname=127.0.0.1, EXCEPTION=java.io.IOException: winproxy return status=0x80041010 errmsg=無効なクラスです Re: SAP HANA Connection Error I set properties as hana.port,hana.dbnames,hana.user,hana.pass and hana.dbnames.url. I wonder if Collector config proxy settings are effective for HANA connection. How can I use JDBC parameters as proxyHostname, proxyPort and proxyHttp ? SAP HANA Connection Error Here are logs of SAP HANA test script. I set properties as hana.user,hana.pass and hana.dbnames. I want to set port number clearly but I cloud not find such property. In the logs the part of port number is “1692041235”. It should be 443. I may need to handle “hana.${instanceName.trim()}.url” in script. How can I collect this problem ? [2023-08-03 17:12:47.998 JST] [MSG] [INFO] [PollNow-38-2::testscript:Test:datasource:embed:XXXXXX.hana.prod-jp10.hanacloud.ondemand.com:1692041235] [PollNowScriptExecutor.execute:90] Start to execute the poll now test script, CONTEXT=host=XXXXXX.hana.prod-jp10.hanacloud.ondemand.com, timeout=50, type=embed, argument=, scriptName= [2023-08-03 17:12:48.079 JST] [MSG] [INFO] [collector-discover-thread-4-38::discover:adtask:16910503330560001:ad_port:Port-] [DiscoveryTask.run:443] DiscoveryTask start, CONTEXT=taskId=16910503330560001, duplicateId=98-Port-, status=EXECUTING [2023-08-03 17:12:48.167 JST] [MSG] [INFO] [PollNow-38-2::testscript:Test:datasource:embed:XXXXXX.hana.prod-jp10.hanacloud.ondemand.com:1692041235] [TestScriptPollNow._handle:156] Finish poll now test script, CONTEXT=result={"output":"H00.AllStartValue=6.0\r\n","responseTime":169,"module":"datasource","exitCode":0,"stderr":""} Solved
Top ContributionsSAP HANA Connection ErrorSolvedSAP_HANA_SystemDatabaseAvailability Test DataSource Script failedSolvedDo you have datasources of top 10 cpu utilization ?invalid Output format - root element of output JSON should be "data"java.lang.NullPointerException on Groovy Collector Attribute scriptRe: SAP HANA Connection ErrorRe: SAP HANA Connection ErrorRe: SAP_HANA_SystemDatabaseAvailability Test DataSource Script failedCollector cold standby configurationHANA Monitoring over proxy