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=無効なクラスです