I am trying to monitor MSSQL using metricbeat but I found some strange errors.
I am trying to monitor SQL Cluster with IP and SQL instance name. But I see whenever I use the correct SQL server details then it's connecting to localhost.
When I give the wrong IP of server name then it's trying to connect the correct one.
Below is my conf
- module: mssql
metricsets:
- "transaction_log"
- "performance"
hosts: ["sqlserver://SQLINSTANCE"]
username: domain\username
password: Securepassword
period: 10
I have attached both logs with the correct SQL servername and the wrong server name.
PS C:\Program Files\metricbeat2_7102> .\metricbeat.exe -e -c .\metricbeat.yml
2021-01-20T15:53:19.368+0100 INFO instance/beat.go:645 Home path: [C:\Program Files\metricbeat2_7102] Config path: [C:\Program Files\metricbeat2_7102] Data path: [C:\Program Files\metricbeat2_7102\data] Logs path: [C:\Program Files\metricbeat2_7102\logs]
2021-01-20T15:53:19.369+0100 INFO instance/beat.go:653 Beat ID: a5b8cff5-1ba5-47ac-a86c-a1ae6705b7a3
2021-01-20T15:53:19.394+0100 INFO [beat] instance/beat.go:981 Beat info {"system_info": {"beat": {"path": {"config": "C:\\Program Files\\metricbeat2_7102", "data": "C:\\Program Files\\metricbeat2_7102\\data", "home": "C:\\Program Files\\metricbeat2_7102",
"logs": "C:\\Program Files\\metricbeat2_7102\\logs"}, "type": "metricbeat", "uuid": "a5b8cff5-1ba5-47ac-a86c-a1ae6705b7a3"}}}
2021-01-20T15:53:19.395+0100 INFO [beat] instance/beat.go:990 Build info {"system_info": {"build": {"commit": "aacf9ecd9c494aa0908f61fbca82c906b16562a8", "libbeat": "7.10.2", "time": "2021-01-12T23:22:55.000Z", "version": "7.10.2"}}}
2021-01-20T15:53:19.395+0100 INFO [beat] instance/beat.go:993 Go runtime info {"system_info": {"go": {"os":"windows","arch":"amd64","max_procs":2,"version":"go1.14.12"}}}
2021-01-20T15:53:19.407+0100 INFO [beat] instance/beat.go:997 Host info {"system_info": {"host": {"architecture":"x86_64","boot_time":"2021-01-16T04:18:38.92+01:00","name":"vmname","ip":["10.99.106.66/24","10.99.25.66/24","10.99.25.68/24","10.99.25.69/
24","10.99.237.1/29","10.99.105.66/24","169.254.2.202/16","::1/128","127.0.0.1/8"],"kernel_version":"10.0.14393.4169 (rs1_release.210107-1130)","mac":["00:50:56:86:21:e1","00:50:56:86:ba:71","00:50:56:86:52:ff","00:50:56:86:78:e2","02:9f:7b:5e:34:f9"],"os":{"family":"win
dows","platform":"windows","name":"Windows Server 2016 Datacenter","version":"10.0","major":10,"minor":0,"patch":0,"build":"14393.4169"},"timezone":"CET","timezone_offset_sec":3600,"id":"53978859-35a9-402e-94c8-01a00295312f"}}}
2021-01-20T15:53:19.408+0100 INFO [beat] instance/beat.go:1026 Process info {"system_info": {"process": {"cwd": "C:\\Program Files\\metricbeat2_7102", "exe": "C:\\Program Files\\metricbeat2_7102\\metricbeat.exe", "name": "metricbeat.exe", "pid": 9280, "ppid":
5628, "start_time": "2021-01-20T15:53:18.687+0100"}}}
2021-01-20T15:53:19.408+0100 INFO instance/beat.go:299 Setup Beat: metricbeat; Version: 7.10.2
2021-01-20T15:53:19.409+0100 INFO [publisher] pipeline/module.go:113 Beat name: vmname
2021-01-20T15:53:19.595+0100 INFO instance/beat.go:455 metricbeat start running.
2021-01-20T15:53:19.595+0100 INFO [monitoring] log/log.go:118 Starting metrics logging every 30s
2021-01-20T15:53:21.604+0100 INFO [monitoring] log/log.go:153 Total non-zero metrics {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":125,"time":{"ms":125}},"total":{"ticks":281,"time":{"ms":281},"value":281},"user":{"ticks":156,"time":{"ms":156}}}
,"handles":{"open":218},"info":{"ephemeral_id":"07f37ab7-6f93-41ed-9e9a-b483bb08bb66","uptime":{"ms":2855}},"memstats":{"gc_next":16323904,"memory_alloc":9876376,"memory_total":36700232,"rss":55472128},"runtime":{"goroutines":49}},"libbeat":{"config":{"module":{"running"
:0}},"output":{"type":"logstash"},"pipeline":{"clients":2,"events":{"active":0}}},"system":{"cpu":{"cores":2}}}}}
2021-01-20T15:53:21.604+0100 INFO [monitoring] log/log.go:154 Uptime: 2.8551547s
2021-01-20T15:53:21.605+0100 INFO [monitoring] log/log.go:131 Stopping metrics logging.
2021-01-20T15:53:21.605+0100 INFO instance/beat.go:461 metricbeat stopped.
2021-01-20T15:53:21.606+0100 ERROR instance/beat.go:956 Exiting: 2 errors: could not create connection to db: error doing ping to db: Unable to open tcp connection with host 'localhost:1433': dial tcp 127.0.0.1:1433: connectex: No connection could be made because
the target machine actively refused it.; could not create connection to db: error doing ping to db: Unable to open tcp connection with host 'localhost:1433': dial tcp 127.0.0.1:1433: connectex: No connection could be made because the target machine actively refused it.
Exiting: 2 errors: could not create connection to db: error doing ping to db: Unable to open tcp connection with host 'localhost:1433': dial tcp 127.0.0.1:1433: connectex: No connection could be made because the target machine actively refused it.; could not create conne
ction to db: error doing ping to db: Unable to open tcp connection with host 'localhost:1433': dial tcp 127.0.0.1:1433: connectex: No connection could be made because the target machine actively refused it.
Below is the log with the wrong SQL instance name
PS C:\Program Files\metricbeat2_7102> .\metricbeat.exe -e -c .\metricbeat.yml
2021-01-20T20:36:35.021+0100 INFO instance/beat.go:645 Home path: [C:\Program Files\metricbeat2_7102] Config path: [C:\Program Files\metricbeat2_7102] Data path: [C:\Program Files\metricbeat2_7102\data] Logs path: [C:\Program Files\metricbeat2_7102\logs]
2021-01-20T20:36:35.022+0100 INFO instance/beat.go:653 Beat ID: a5b8cff5-1ba5-47ac-a86c-a1ae6705b7a3
2021-01-20T20:36:35.044+0100 INFO [beat] instance/beat.go:981 Beat info {"system_info": {"beat": {"path": {"config": "C:\\Program Files\\metricbeat2_7102", "data": "C:\\Program Files\\metricbeat2_7102\\data", "home": "C:\\Program Files\\metricbeat2_7102",
"logs": "C:\\Program Files\\metricbeat2_7102\\logs"}, "type": "metricbeat", "uuid": "a5b8cff5-1ba5-47ac-a86c-a1ae6705b7a3"}}}
2021-01-20T20:36:35.045+0100 INFO [beat] instance/beat.go:990 Build info {"system_info": {"build": {"commit": "aacf9ecd9c494aa0908f61fbca82c906b16562a8", "libbeat": "7.10.2", "time": "2021-01-12T23:22:55.000Z", "version": "7.10.2"}}}
2021-01-20T20:36:35.045+0100 INFO [beat] instance/beat.go:993 Go runtime info {"system_info": {"go": {"os":"windows","arch":"amd64","max_procs":2,"version":"go1.14.12"}}}
2021-01-20T20:36:35.058+0100 INFO [beat] instance/beat.go:997 Host info {"system_info": {"host": {"architecture":"x86_64","boot_time":"2021-01-16T04:18:39.18+01:00","name":"vmname","ip":["10.99.106.66/24","10.99.25.66/24","10.99.25.68/24","10.99.25.69/
24","10.99.237.1/29","10.99.105.66/24","169.254.2.202/16","::1/128","127.0.0.1/8"],"kernel_version":"10.0.14393.4169 (rs1_release.210107-1130)","mac":["00:50:56:86:21:e1","00:50:56:86:ba:71","00:50:56:86:52:ff","00:50:56:86:78:e2","02:9f:7b:5e:34:f9"],"os":{"family":"win
dows","platform":"windows","name":"Windows Server 2016 Datacenter","version":"10.0","major":10,"minor":0,"patch":0,"build":"14393.4169"},"timezone":"CET","timezone_offset_sec":3600,"id":"53978859-35a9-402e-94c8-01a00295312f"}}}
2021-01-20T20:36:35.058+0100 INFO [beat] instance/beat.go:1026 Process info {"system_info": {"process": {"cwd": "C:\\Program Files\\metricbeat2_7102", "exe": "C:\\Program Files\\metricbeat2_7102\\metricbeat.exe", "name": "metricbeat.exe", "pid": 12364, "ppid"
: 5628, "start_time": "2021-01-20T20:36:34.340+0100"}}}
2021-01-20T20:36:35.058+0100 INFO instance/beat.go:299 Setup Beat: metricbeat; Version: 7.10.2
2021-01-20T20:36:35.059+0100 INFO [publisher] pipeline/module.go:113 Beat name: vmname
2021-01-20T20:36:38.045+0100 INFO [add_cloud_metadata] add_cloud_metadata/add_cloud_metadata.go:89 add_cloud_metadata: hosting provider type not detected.
2021-01-20T20:36:39.618+0100 INFO instance/beat.go:424 metricbeat stopped.
2021-01-20T20:36:39.618+0100 ERROR instance/beat.go:956 Exiting: 2 errors: could not create connection to db: error doing ping to db: lookup nosqlinstance: no such host; could not create connection to db: error doing ping to db: lookup nosqlinstance: no such host
Exiting: 2 errors: could not create connection to db: error doing ping to db: lookup nosqlinstance: no such host; could not create connection to db: error doing ping to db: lookup nosqlinstance: no such host
Does anyone have any idea on this?