MSSQL plug-in - Do data

The Issue
I don’t have SQL monitoring data on the CheckMK services GUI or in the agent output (pasted below). But I seem to get an output when I run cscript mssql.vbs on the command-line (in the checkmk plugins directory on the Windows server where the agent and MSSQL are installed). I haven’t added it here already since it’s really long, but I can add it if needed.

I was wondering if there is a specific rule to enable to be able to see services or a way to confirm why they appear when running cscript MSSQL.vbs but not in the agent output or GUI.

Thanks!

CMK version:
2.2.0p12 raw

OS version:
Windows Server 2022

Error message:
None on this server specifically, but some of our SQL servers (configured to use the default SYSTEM user) have this issue when launching the MSSQL.vbs script on command line with: cscript ./mssql.vbs

Connecting using provider msoledbsql; Connecting using provider sqloledb; Connecting using provider sqlncli11 ;; ERROR: Login failed for user ‘’.; Login failed for user ‘’.

Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)

Checkmk version 2.2.0p12
+ FETCHING DATA
  Source: SourceInfo(hostname='(HOSTNAME_OF_Server)', ipaddress='(IP_Address)', ident='agent', fetcher_type=<FetcherType.TCP: 8>, source_type=<SourceType.HOST: 1>)
[cpu_tracking] Start [7f8a721b1650]
Read from cache: AgentFileCache((HOSTNAME_OF_Server), path_template=/omd/sites/labplas/tmp/check_mk/cache/{hostname}, max_age=MaxAge(checking=0, discovery=90.0, inventory=90.0), simulation=False, use_only_cache=False                                                                                , file_cache_mode=6)
Not using cache (Too old. Age is 18 sec, allowed is 0 sec)
[TCPFetcher] Execute data source
Connecting via TCP to (IP_Address):6556 (180.0s timeout)
Detected transport protocol: TransportProtocol.PLAIN (b'<<')
Reading data from agent
Closing TCP connection to (IP_Address):6556
Write data to cache file /omd/sites/labplas/tmp/check_mk/cache/(HOSTNAME_OF_Server)
Trying to acquire lock on /omd/sites/labplas/tmp/check_mk/cache/(HOSTNAME_OF_Server)
Got lock on /omd/sites/labplas/tmp/check_mk/cache/(HOSTNAME_OF_Server)
Releasing lock on /omd/sites/labplas/tmp/check_mk/cache/(HOSTNAME_OF_Server)
Released lock on /omd/sites/labplas/tmp/check_mk/cache/(HOSTNAME_OF_Server)
[cpu_tracking] Stop [7f8a721b1650 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.830000001937151))]
  Source: SourceInfo(hostname='(HOSTNAME_OF_Server)', ipaddress='(IP_Address)', ident='piggyback', fetcher_type=<FetcherType.PIGGYBACK: 4>, source_type=<SourceType.HOST: 1>)
[cpu_tracking] Start [7f8a721b1490]
Read from cache: NoCache((HOSTNAME_OF_Server), path_template=/dev/null, max_age=MaxAge(checking=0.0, discovery=0.0, inventory=0.0), simulation=False, use_only_cache=False, file_cache_mode=1)
[PiggybackFetcher] Execute data source
No piggyback files for '(HOSTNAME_OF_Server)'. Skip processing.
No piggyback files for '(IP_Address)'. Skip processing.
[cpu_tracking] Stop [7f8a721b1490 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
+ PARSE FETCHER RESULTS
<<<check_mk>>> / Transition NOOPParser -> HostSectionParser
<<<cmk_agent_ctl_status:sep(0)>>> / Transition HostSectionParser -> HostSectionParser
<<<wmi_cpuload:sep(124)>>> / Transition HostSectionParser -> HostSectionParser
<<<uptime>>> / Transition HostSectionParser -> HostSectionParser
<<<mem>>> / Transition HostSectionParser -> HostSectionParser
<<<fileinfo:sep(124)>>> / Transition HostSectionParser -> HostSectionParser
<<<winperf_phydisk>>> / Transition HostSectionParser -> HostSectionParser
<<<winperf_if>>> / Transition HostSectionParser -> HostSectionParser
<<<winperf_processor>>> / Transition HostSectionParser -> HostSectionParser
<<<df:sep(9)>>> / Transition HostSectionParser -> HostSectionParser
<<<logwatch>>> / Transition HostSectionParser -> HostSectionParser
<<<checkmk_agent_plugins_win:sep(0)>>> / Transition HostSectionParser -> HostSectionParser
<<<dotnet_clrmemory:sep(124)>>> / Transition HostSectionParser -> HostSectionParser
<<<ps:sep(9)>>> / Transition HostSectionParser -> HostSectionParser
<<<services>>> / Transition HostSectionParser -> HostSectionParser
Transition HostSectionParser -> NOOPParser
Transition NOOPParser -> NOOPParser
<<<systemtime>>> / Transition NOOPParser -> HostSectionParser
  HostKey(hostname='(HOSTNAME_OF_Server)', source_type=<SourceType.HOST: 1>)  -> Add sections: ['check_mk', 'checkmk_agent_plugins_win', 'cmk_agent_ctl_status', 'df', 'dotnet_clrmemory', 'fileinfo', 'logwatch', 'mem', 'ps', 'services', 'systemtime', 'uptime', 'winperf_if', 'winperf_phydisk', 'winperf_processor', 'wmi_cpuload']
  HostKey(hostname='(HOSTNAME_OF_Server)', source_type=<SourceType.HOST: 1>)  -> Add sections: []
Received no piggyback data
[cpu_tracking] Start [7f8a721c9c50]
value store: synchronizing
Trying to acquire lock on /omd/sites/labplas/tmp/check_mk/counters/(HOSTNAME_OF_Server)
Got lock on /omd/sites/labplas/tmp/check_mk/counters/(HOSTNAME_OF_Server)
value store: loading from disk
Releasing lock on /omd/sites/labplas/tmp/check_mk/counters/(HOSTNAME_OF_Server)
Released lock on /omd/sites/labplas/tmp/check_mk/counters/(HOSTNAME_OF_Server)
CPU utilization      Total CPU: 2.30%
Check_MK Agent       Version: 2.2.0p12, OS: windows, TLS is not activated on monitored host (see details)(!), Agent plugins: 0, Local checks: 0
Disk IO SUMMARY      Read: 0.00 B/s, Write: 26.1 kB/s, Latency: 109 microseconds
Filesystem C:/       Used: 9.21% - 18.4 GiB of 199 GiB, trend per 1 day 0 hours: +5.28 GiB, trend per 1 day 0 hours: +2.64%, Time left until disk full: 34 days 7 hours
Interface 1          [Intel[R] 82574L Gigabit Network Connection], (Connected), Speed: 1 GBit/s, In: 5.36 kB/s (<0.01%), Out: 1.70 kB/s (<0.01%)
Memory and pagefile  RAM: 20.64% - 2.48 GiB of 12.0 GiB, 15 min average: 20.08% (2.41 GiB), Commit charge: 16.48% - 2.37 GiB of 14.4 GiB, 15 min average: 16.06% (2.31 GiB)
Processor Queue      15 min load: 0.00, 15 min load per core: 0.00 (4 logical cores)
Service Summary      Autostart services: 64, Stopped services: 2
System Time          Offset: -555 milliseconds
Uptime               Up since Feb 06 2024 13:42:13, Uptime: 1 hour 40 minutes
+ EXECUTING INVENTORY PLUGINS
 allnet_ip_sensoric: skipped (no data)
 allnet_ip_sensoric: skipped (no data)
 aruba_wlc_aps: skipped (no data)
 aruba_wlc_aps: skipped (no data)
 check_mk: ok
 check_mk: skipped (no data)
 checkmk_agent_plugins: ok
 checkmk_agent_plugins: skipped (no data)
 cisco_meraki_org_device_info: skipped (no data)
 cisco_meraki_org_device_info: skipped (no data)
 dell_hw_info: skipped (no data)
 dell_hw_info: skipped (no data)
 docker_node_info: skipped (no data)
 docker_node_info: skipped (no data)
 esx_systeminfo: skipped (no data)
 esx_systeminfo: skipped (no data)
 fireeye_sys_status: skipped (no data)
 fireeye_sys_status: skipped (no data)
 fritz: skipped (no data)
 fritz: skipped (no data)
 hp_proliant_da_phydrv: skipped (no data)
 hp_proliant_da_phydrv: skipped (no data)
 hp_proliant_mem: skipped (no data)
 hp_proliant_mem: skipped (no data)
 hp_proliant_systeminfo: skipped (no data)
 hp_proliant_systeminfo: skipped (no data)
 ibm_mq_channels: skipped (no data)
 ibm_mq_channels: skipped (no data)
 ibm_mq_managers: skipped (no data)
 ibm_mq_managers: skipped (no data)
 ibm_mq_queues: skipped (no data)
 ibm_mq_queues: skipped (no data)
 infoblox_osinfo: skipped (no data)
 infoblox_osinfo: skipped (no data)
 infoblox_systeminfo: skipped (no data)
 infoblox_systeminfo: skipped (no data)
 inv_cisco_vlans: skipped (no data)
 inv_cisco_vlans: skipped (no data)
 inv_esx_vsphere_hostsystem: skipped (no data)
 inv_esx_vsphere_hostsystem: skipped (no data)
 inv_if: ok
 inv_if: skipped (no data)
 aix_baselevel: skipped (no data)
 aix_baselevel: skipped (no data)
 aix_lparstat_inventory: skipped (no data)
 aix_lparstat_inventory: skipped (no data)
 aix_packages: skipped (no data)
 aix_packages: skipped (no data)
 aix_service_packs: skipped (no data)
 aix_service_packs: skipped (no data)
 azure_load_balancer: skipped (no data)
 azure_load_balancer: skipped (no data)
 inventory_checkmk: skipped (no data)
 inventory_checkmk: skipped (no data)
 checkpoint_vpn_tunnels: skipped (no data)
 checkpoint_vpn_tunnels: skipped (no data)
 citrix_controller: skipped (no data)
 citrix_controller: skipped (no data)
 citrix_state: skipped (no data)
 citrix_state: skipped (no data)
 couchbase_nodes_ports: skipped (no data)
 couchbase_nodes_ports: skipped (no data)
 dmidecode: skipped (no data)
 dmidecode: skipped (no data)
 docker_container_labels: skipped (no data)
 docker_container_labels: skipped (no data)
 docker_container_network: skipped (no data)
 docker_container_network: skipped (no data)
 inventory_docker_container_node_name: skipped (no data)
 inventory_docker_container_node_name: skipped (no data)
 docker_node_images: skipped (no data)
 docker_node_images: skipped (no data)
 docker_node_network: skipped (no data)
 docker_node_network: skipped (no data)
 enviromux_micro_information: skipped (no data)
 enviromux_micro_information: skipped (no data)
 inventory_esx_vsphere_clusters: skipped (no data)
 inventory_esx_vsphere_clusters: skipped (no data)
 inventory_esx_vsphere_virtual_machines: skipped (no data)
 inventory_esx_vsphere_virtual_machines: skipped (no data)
 fortiauthenticator_system: skipped (no data)
 fortiauthenticator_system: skipped (no data)
 fortigate_ha: skipped (no data)
 fortigate_ha: skipped (no data)
 fortimail_system: skipped (no data)
 fortimail_system: skipped (no data)
 fortinet_firewall_network_interfaces: skipped (no data)
 fortinet_firewall_network_interfaces: skipped (no data)
 fortisandbox_software: skipped (no data)
 fortisandbox_software: skipped (no data)
 fortisandbox_system: skipped (no data)
 fortisandbox_system: skipped (no data)
 ipmi_firmware: skipped (no data)
 ipmi_firmware: skipped (no data)
 k8s_service_info: skipped (no data)
 k8s_service_info: skipped (no data)
 kube_cluster: skipped (no data)
 kube_cluster: skipped (no data)
 kube_cronjob: skipped (no data)
 kube_cronjob: skipped (no data)
 kube_daemonset: skipped (no data)
 kube_daemonset: skipped (no data)
 kube_deployment: skipped (no data)
 kube_deployment: skipped (no data)
 kube_namespace: skipped (no data)
 kube_namespace: skipped (no data)
 kube_node: skipped (no data)
 kube_node: skipped (no data)
 kube_pod: skipped (no data)
 kube_pod: skipped (no data)
 kube_statefulset: skipped (no data)
 kube_statefulset: skipped (no data)
 lnx_block_devices: skipped (no data)
 lnx_block_devices: skipped (no data)
 lnx_ip_r: skipped (no data)
 lnx_ip_r: skipped (no data)
 lnx_packages: skipped (no data)
 lnx_packages: skipped (no data)
 lnx_sysctl: skipped (no data)
 lnx_sysctl: skipped (no data)
 lnx_video: skipped (no data)
 lnx_video: skipped (no data)
 mobileiron_inventory: skipped (no data)
 mobileiron_inventory: skipped (no data)
 mssql_clusters: skipped (no data)
 mssql_clusters: skipped (no data)
 oracle_systemparameter: skipped (no data)
 oracle_systemparameter: skipped (no data)
 primekey: skipped (no data)
 primekey: skipped (no data)
 snmp_extended_info: skipped (no data)
 snmp_extended_info: skipped (no data)
 solaris_addresses: skipped (no data)
 solaris_addresses: skipped (no data)
 solaris_pkginfo: skipped (no data)
 solaris_pkginfo: skipped (no data)
 solaris_cpus: skipped (no data)
 solaris_cpus: skipped (no data)
 solaris_routes: skipped (no data)
 solaris_routes: skipped (no data)
 statgrab_net: skipped (no data)
 statgrab_net: skipped (no data)
 win_bios: skipped (no data)
 win_bios: skipped (no data)
 win_disks: skipped (no data)
 win_disks: skipped (no data)
 win_exefiles: skipped (no data)
 win_exefiles: skipped (no data)
 win_ip_r: skipped (no data)
 win_ip_r: skipped (no data)
 win_networkadapter: skipped (no data)
 win_networkadapter: skipped (no data)
 win_reg_uninstall: skipped (no data)
 win_reg_uninstall: skipped (no data)
 win_video: skipped (no data)
 win_video: skipped (no data)
 win_wmi_software: skipped (no data)
 win_wmi_software: skipped (no data)
 win_wmi_updates: skipped (no data)
 win_wmi_updates: skipped (no data)
 juniper_info: skipped (no data)
 juniper_info: skipped (no data)
 k8s_pod_container: skipped (no data)
 k8s_pod_container: skipped (no data)
 lnx_cpuinfo: skipped (no data)
 lnx_cpuinfo: skipped (no data)
 lnx_distro: skipped (no data)
 lnx_distro: skipped (no data)
 lnx_if: skipped (no data)
 lnx_if: skipped (no data)
 lnx_uname: skipped (no data)
 lnx_uname: skipped (no data)
 lparstat_aix: skipped (no data)
 lparstat_aix: skipped (no data)
 mem: ok
 mem: skipped (no data)
 mem_used: skipped (no data)
 mem_used: skipped (no data)
 mssql_instance: skipped (no data)
 mssql_instance: skipped (no data)
 netapp_api_disk: skipped (no data)
 netapp_api_disk: skipped (no data)
 netapp_api_info: skipped (no data)
 netapp_api_info: skipped (no data)
 oracle_dataguard_stats: skipped (no data)
 oracle_dataguard_stats: skipped (no data)
 oracle_instance: skipped (no data)
 oracle_instance: skipped (no data)
 oracle_performance: skipped (no data)
 oracle_performance: skipped (no data)
 oracle_recovery_area: skipped (no data)
 oracle_recovery_area: skipped (no data)
 oracle_tablespaces: skipped (no data)
 oracle_tablespaces: skipped (no data)
 perle_chassis: skipped (no data)
 perle_chassis: skipped (no data)
 perle_chassis_slots: skipped (no data)
 perle_chassis_slots: skipped (no data)
 perle_psmu: skipped (no data)
 perle_psmu: skipped (no data)
 prtconf: skipped (no data)
 prtconf: skipped (no data)
 snmp_quantum_storage_info: skipped (no data)
 snmp_quantum_storage_info: skipped (no data)
 snmp_info: skipped (no data)
 snmp_info: skipped (no data)
 solaris_prtdiag: skipped (no data)
 solaris_prtdiag: skipped (no data)
 solaris_uname: skipped (no data)
 solaris_uname: skipped (no data)
 suseconnect: skipped (no data)
 suseconnect: skipped (no data)
 win_computersystem: skipped (no data)
 win_computersystem: skipped (no data)
 win_cpuinfo: skipped (no data)
 win_cpuinfo: skipped (no data)
 win_os: skipped (no data)
 win_os: skipped (no data)
 win_system: skipped (no data)
 win_system: skipped (no data)
 winperf_if: ok
 winperf_if: skipped (no data)
No piggyback files for '(HOSTNAME_OF_Server)'. Skip processing.
No piggyback files for '(IP_Address)'. Skip processing.
[cpu_tracking] Stop [7f8a721c9c50 - Snapshot(process=posix.times_result(user=0.020000000000000018, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.019999999552965164))]
[agent] Success, [piggyback] Success (but no data found for this host), execution time 0.9 sec | execution_time=0.850 user_time=0.020 system_time=0.000 children_user_time=0.000 children_system_time=0.000 cmk_time_agent=0.830

Is the mssql.vbs script inside the "C:\ProgramData\checkmk\agent\plugins" folder or the program files one?
To be executed it must be inside the Programdata one.
Another point you need to pay attention to is the user the agent runs with → LocalSystem
Here you find some remarks for the access rights needed on MSSQL.
https://checkmk.atlassian.net/wiki/spaces/KB/pages/9471714/Minimal+database+permissions+for+the+agent+plug-in+mssql.vbs

Thanks for the answer Andreas, I actually had no idea it should go in ProgramData, but I did find it weird that all plugins were already on every host (with the raw edition at least), that explains that. I can at least confirm it works on that server!

For the other one, I still get that error: Connecting using provider msoledbsql; Connecting using provider sqloledb; Connecting using provider sqlncli11 ;; ERROR: Login failed for user ‘’.; Login failed for user ‘’.

The SYSTEM user is allowed to login, access SQL and has the 3 permissions mentioned in the article.

I also tried creating an mssql.ini file and placing it in the $MK_CONFIG directory (which in my case was C:\programdata\checkmk\agent\config according to C:\program files(x86)\checkmk\check_mg_agent.exe showconfig ps. But I still get the same error, as if it doesn’t even try to use a certain user to connect. Any idea?

Otherwise I’m still gonna be looking, it worked on a fresh new SQL server, but doesn’t work on those, which I’ve been told had a pretty basic/default configuration. Hopefully I can find something. But hey, at least I learnt I’ve never had an active plugin running anywhere (I assume since I never transferred anything to programdata). So that’s new.