MySql VBS error, iIlegal procedure or arg

CMK version: raw-2.0.0p8
This is Check_MK version 2.0.0p8 CRE
Client check_mk_agent version is 2.0.0p8 in most cases with some being 1.6 and still having the issue.

OS version:
CMK Server: CentOS7
CMK Client: windows 2012r2

MYSQL is 5.5 versions

Error message:
mk_mysql.vbs plugin is working on multiple servers, but fails on some. What I found on the servers where it was failing is when executing the mk_mysql.vbs with cscript is that it indicates an invalid procedure or argument (77,5), Mid. (On servers working, manually running the script works, it just indicates login as odbc user w/no password, and fails mysql instance discovery due to auth; which is ok as I expect manually running the script doesn’t use auth info in mysql.ini.)

FYI

ERROR:
From a CMK perspective, no new services found and the log indicates vbs ran, suceded*, but generated no data

FROM CMK Log:
2023-01-18 13:17:34.190 [srv 13432] perf: In [438] milliseconds process ‘cscript.exe //Nologo “C:\ProgramData\checkmk\agent\plugins\mk_mysql.vbs”’ pid:[5024] SUCCEDED - generated [0] bytes of data in [0] blocks
2023-01-18 13:17:34.191 [srv 13432] [Warn ] Process ‘C:\ProgramData\checkmk\agent\plugins\mk_mysql.vbs’ has no data

From manual cmd line in admin mode:
c:\ProgramData\checkmk\agent\plugins>cscript.exe //Nologo “C:\ProgramData\checkmk\agent\plugins\mk_mysql.vbs”

C:\ProgramData\checkmk\agent\plugins\mk_mysql.vbs(77, 5) Microsoft VBScript runtime error: Invalid procedure call or argument: ‘Mid’

I’ve tried commenting that line out or initializing fromLen = 1 to no avail, the script simply hangs and doesn’t respond. The conn_args line, 77, of mk_mysql.vbs is pointed as the culprit.

    pos = InStrRev(output, vbCrLf, Len(output)-1)
    conn_args = Mid(output, pos+2, Len(output)-pos-4)

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

NOTE: The first two are of servers having issues, phxc-server1 and fedh-server1 and the last server that is working is smtn-server1

OMD[rd]:~$ cmk --debug -vvn phxc-server1
Checkmk version 2.0.0p8
Try license usage history update.
Trying to acquire lock on /omd/sites/rd/var/check_mk/license_usage/next_run
Got lock on /omd/sites/rd/var/check_mk/license_usage/next_run
Trying to acquire lock on /omd/sites/rd/var/check_mk/license_usage/history.json
Got lock on /omd/sites/rd/var/check_mk/license_usage/history.json
Next run time has not been reached yet. Abort.
Releasing lock on /omd/sites/rd/var/check_mk/license_usage/history.json
Released lock on /omd/sites/rd/var/check_mk/license_usage/history.json
Releasing lock on /omd/sites/rd/var/check_mk/license_usage/next_run
Released lock on /omd/sites/rd/var/check_mk/license_usage/next_run
Loading autochecks from /omd/sites/rd/var/check_mk/autochecks/phxc-server1.mk

  • FETCHING DATA
    Source: SourceType.HOST/FetcherType.TCP
    [cpu_tracking] Start [7fce656f8e80]
    Connecting via TCP to phxc-server1:6556 (5.0s timeout)
    [TCPFetcher] Fetch with cache settings: DefaultAgentFileCache(base_path=PosixPath(‘/omd/sites/rd/tmp/check_mk/cache/phxc-server1’), max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)
    Not using cache (Too old. Age is 2 sec, allowed is 0 sec)
    [TCPFetcher] Execute data source
    Reading data from agent
    Output is not encrypted
    Write data to cache file /omd/sites/rd/tmp/check_mk/cache/phxc-server1
    Trying to acquire lock on /omd/sites/rd/tmp/check_mk/cache/phxc-server1
    Got lock on /omd/sites/rd/tmp/check_mk/cache/phxc-server1
    Releasing lock on /omd/sites/rd/tmp/check_mk/cache/phxc-server1
    Released lock on /omd/sites/rd/tmp/check_mk/cache/phxc-server1
    Closing TCP connection to phxc-server1:6556
    [cpu_tracking] Stop [7fce656f8e80 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.7699999995529652))]
    Source: SourceType.HOST/FetcherType.PIGGYBACK
    [cpu_tracking] Start [7fce6570a340]
    No piggyback files for ‘phxc-server1’. Skip processing.
    No piggyback files for ‘phxc-server1’. Skip processing.
    [PiggybackFetcher] Fetch with cache settings: NoCache(base_path=PosixPath(‘/omd/sites/rd/tmp/check_mk/data_source_cache/piggyback/phxc-server1’), max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)
    [PiggybackFetcher] Execute data source
    [cpu_tracking] Stop [7fce6570a340 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
    [cpu_tracking] Start [7fce656f8bb0]
  • PARSE FETCHER RESULTS
    Source: SourceType.HOST/FetcherType.TCP
    No persisted sections loaded
    → Add sections: [‘check_mk’, ‘df’, ‘dotnet_clrmemory’, ‘fileinfo’, ‘logwatch’, ‘mem’, ‘ps’, ‘services’, ‘systemtime’, ‘uptime’, ‘winperf_if’, ‘winperf_phydisk’, ‘winperf_processor’, ‘wmi_cpuload’]
    Source: SourceType.HOST/FetcherType.PIGGYBACK
    No persisted sections loaded
    → Add sections: []
    Received no piggyback data
    Loading item states
    Trying to acquire lock on /omd/sites/rd/tmp/check_mk/counters/phxc-server1
    Got lock on /omd/sites/rd/tmp/check_mk/counters/phxc-server1
    Releasing lock on /omd/sites/rd/tmp/check_mk/counters/phxc-server1
    Released lock on /omd/sites/rd/tmp/check_mk/counters/phxc-server1
    CPU utilization Total CPU: 28.66%
    Disk IO SUMMARY Read: 663 kB/s, Write: 221 kB/s, Latency: 2 milliseconds
    DotNet Memory Management Global Time in GC: 0.22%
    Filesystem C:/ 69.2% used (92.09 of 133.08 GB), trend: +332.06 MB / 24 hours
    Filesystem D:/ 69.53% used (647.37 of 931.00 GB), trend: +96.07 MB / 24 hours
    Interface 1 [Broadcom NetXtreme Gigabit Ethernet], (Connected), Speed: 1 GBit/s, In: 366 kB/s (0.29%), Out: 823 kB/s (0.66%)
    Interface 2 [isatap.{5FEDE6B7-7399-4AE2-8A24-7E5F978B7B09}], (Connected), Speed: 100 kBit/s, In: 0.00 B/s (0%), Out: 0.00 B/s (0%)
    Log Active Directory Web Services 39 CRIT, 3 WARN messages (Last worst: “Oct 23 07:03:13 49152.1202 ADWS This computer is now hosting the specified directory instance, but Active Directory Web Services could not service it. Active Directory Web Services will retry this operation periodically. Directory instance: NTDS Directory instance LDAP port: 389 Directory instance SSL port: 636”)
    Log Application Unacknowledged messages have exceeded max size, new messages are dropped (limit 500,000 B)
    Log COMODO Client - Security CEF Unacknowledged messages have exceeded max size, new messages are dropped (limit 500,000 B)
    Log COMODO Client - Security Trace Unacknowledged messages have exceeded max size, new messages are dropped (limit 500,000 B)
    Log DFS Replication Unacknowledged messages have exceeded max size, new messages are dropped (limit 500,000 B)
    Log DNS Server Unacknowledged messages have exceeded max size, new messages are dropped (limit 500,000 B)
    Log Directory Service Unacknowledged messages have exceeded max size, new messages are dropped (limit 500,000 B)
    Log HardwareEvents No error messages
    Log Internet Explorer No error messages
    Log Key Management Service No error messages
    Log Security Unacknowledged messages have exceeded max size, new messages are dropped (limit 500,000 B)
    Log System Unacknowledged messages have exceeded max size, new messages are dropped (limit 500,000 B)
    Log Windows PowerShell 12 WARN messages (Last worst: “Sep 05 11:13:09 0.300 PowerShell Provider Health: This drive is locked by BitLocker Drive Encryption. You must unlock this drive from Control Panel. . Details: ProviderName=Microsoft.PowerShell.Core\FileSystem ExceptionClass=IOException ErrorCategory= ErrorId= ErrorMessage=This drive is locked by BitLocker Drive Encryption. You must unlock this drive from Control Panel. Severity=Warning SequenceNumber=17 HostName=ServerRemoteHost HostVersion=1.0.0.0 HostId=05b8f03d-5315-4789-8766-a36de4061440 HostApplication=C:\Windows\system32\wsmprovhost.exe -Embedding EngineVersion= RunspaceId= PipelineId= CommandName= CommandType= ScriptName= CommandPath= CommandLine=”)
    Memory and pagefile RAM: 31.97% - 5.10 GB of 15.96 GB, Commit charge: 31.21% - 5.72 GB of 18.33 GB
    Processor Queue 15 min load: 0.00 at 8 logical cores (0.00 per core)
    Service Summary Autostart services: 82, Stopped services: 3
    System Time Offset: 20.8 s
    Uptime Up since Jan 15 2023 07:02:27, Uptime: 3 days 10 hours
    No piggyback files for ‘phxc-server1’. Skip processing.
    No piggyback files for ‘phxc-server1’. Skip processing.
    [cpu_tracking] Stop [7fce656f8bb0 - Snapshot(process=posix.times_result(user=0.020000000000000018, system=0.010000000000000009, children_user=0.0, children_system=0.0, elapsed=0.019999999552965164))]
    [agent] Version: 2.0.0p8, OS: windows, execution time 0.8 sec | execution_time=0.790 user_time=0.020 system_time=0.010 children_user_time=0.000 children_system_time=0.000 cmk_time_agent=0.770
    OMD[rd]:~$
    OMD[rd]:~$
    OMD[rd]:~$
    OMD[rd]:~$
    OMD[rd]:~$ cmk --debug -vvn fedh-server1
    Checkmk version 2.0.0p8
    Try license usage history update.
    Trying to acquire lock on /omd/sites/rd/var/check_mk/license_usage/next_run
    Got lock on /omd/sites/rd/var/check_mk/license_usage/next_run
    Trying to acquire lock on /omd/sites/rd/var/check_mk/license_usage/history.json
    Got lock on /omd/sites/rd/var/check_mk/license_usage/history.json
    Next run time has not been reached yet. Abort.
    Releasing lock on /omd/sites/rd/var/check_mk/license_usage/history.json
    Released lock on /omd/sites/rd/var/check_mk/license_usage/history.json
    Releasing lock on /omd/sites/rd/var/check_mk/license_usage/next_run
    Released lock on /omd/sites/rd/var/check_mk/license_usage/next_run
  • FETCHING DATA
    Source: SourceType.HOST/FetcherType.PIGGYBACK
    [cpu_tracking] Start [7fc869bc5430]
    No piggyback files for ‘fedh-server1’. Skip processing.
    No piggyback files for ‘192.168.24.10’. Skip processing.
    [PiggybackFetcher] Fetch with cache settings: NoCache(base_path=PosixPath(‘/omd/sites/rd/tmp/check_mk/data_source_cache/piggyback/fedh-server1’), max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)
    [PiggybackFetcher] Execute data source
    [cpu_tracking] Stop [7fc869bc5430 - Snapshot(process=posix.times_result(user=0.010000000000000009, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
    [cpu_tracking] Start [7fc869bc5eb0]
  • PARSE FETCHER RESULTS
    Source: SourceType.HOST/FetcherType.PIGGYBACK
    No persisted sections loaded
    → Add sections: []
    Received no piggyback data
    Loading item states
    Trying to acquire lock on /omd/sites/rd/tmp/check_mk/counters/fedh-server1
    Got lock on /omd/sites/rd/tmp/check_mk/counters/fedh-server1
    Releasing lock on /omd/sites/rd/tmp/check_mk/counters/fedh-server1
    Released lock on /omd/sites/rd/tmp/check_mk/counters/fedh-server1
    No piggyback files for ‘fedh-server1’. Skip processing.
    No piggyback files for ‘192.168.24.10’. Skip processing.
    [cpu_tracking] Stop [7fc869bc5eb0 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
    execution time 0.0 sec | execution_time=0.000 user_time=0.010 system_time=0.000 children_user_time=0.000 children_system_time=0.000 cmk_time_agent=0.000
    OMD[rd]:~$
    OMD[rd]:~$
    OMD[rd]:~$
    OMD[rd]:~$
    OMD[rd]:~$ !WORKING SERVER
    -bash: !WORKING: event not found
    OMD[rd]:~$ cmk --debug -vvn smtn-server1
    Checkmk version 2.0.0p8
    Try license usage history update.
    Trying to acquire lock on /omd/sites/rd/var/check_mk/license_usage/next_run
    Got lock on /omd/sites/rd/var/check_mk/license_usage/next_run
    Trying to acquire lock on /omd/sites/rd/var/check_mk/license_usage/history.json
    Got lock on /omd/sites/rd/var/check_mk/license_usage/history.json
    Next run time has not been reached yet. Abort.
    Releasing lock on /omd/sites/rd/var/check_mk/license_usage/history.json
    Released lock on /omd/sites/rd/var/check_mk/license_usage/history.json
    Releasing lock on /omd/sites/rd/var/check_mk/license_usage/next_run
    Released lock on /omd/sites/rd/var/check_mk/license_usage/next_run
    Updating IPv4 DNS cache for smtn-server1: 192.168.23.10
    Trying to acquire lock on /omd/sites/rd/var/check_mk/ipaddresses.cache
    Got lock on /omd/sites/rd/var/check_mk/ipaddresses.cache
    Releasing lock on /omd/sites/rd/var/check_mk/ipaddresses.cache
    Released lock on /omd/sites/rd/var/check_mk/ipaddresses.cache
  • FETCHING DATA
    Source: SourceType.HOST/FetcherType.PIGGYBACK
    [cpu_tracking] Start [7f8786931ee0]
    No piggyback files for ‘smtn-server1’. Skip processing.
    No piggyback files for ‘192.168.23.10’. Skip processing.
    [PiggybackFetcher] Fetch with cache settings: NoCache(base_path=PosixPath(‘/omd/sites/rd/tmp/check_mk/data_source_cache/piggyback/smtn-server1’), max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)
    [PiggybackFetcher] Execute data source
    [cpu_tracking] Stop [7f8786931ee0 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.009999997913837433))]
    [cpu_tracking] Start [7f8786931100]
  • PARSE FETCHER RESULTS
    Source: SourceType.HOST/FetcherType.PIGGYBACK
    No persisted sections loaded
    → Add sections: []
    Received no piggyback data
    Loading item states
    Trying to acquire lock on /omd/sites/rd/tmp/check_mk/counters/smtn-server1
    Got lock on /omd/sites/rd/tmp/check_mk/counters/smtn-server1
    Releasing lock on /omd/sites/rd/tmp/check_mk/counters/smtn-server1
    Released lock on /omd/sites/rd/tmp/check_mk/counters/smtn-server1
    No piggyback files for ‘smtn-server1’. Skip processing.
    No piggyback files for ‘192.168.23.10’. Skip processing.
    [cpu_tracking] Stop [7f8786931100 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
    execution time 0.0 sec | execution_time=0.010 user_time=0.000 system_time=0.000 children_user_time=0.000 children_system_time=0.000 cmk_time_agent=0.010
    OMD[rd]:~$

FYI - this also appears to be an issue on w2016

c:\ProgramData\checkmk\agent\plugins>cscript mk_mysql.vbs
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

c:\ProgramData\checkmk\agent\plugins\mk_mysql.vbs(96, 5) Microsoft VBScript runtime error: Invalid procedure call or argument: ‘Mid’

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.