Mssql.vbs setup

Hi, can anyone describe what should be done to make mssql.vbs work? I have read forum topics, docs. I know there is system auth, there is also user auth method from mysql.ini. My question is image I installed plugin/agent at the moment and what I have supposed to do? what is recommended way of auth? it supposed to work out of box? if not how I can setup recommend auth method? any guide step by step?

Hi,

the mssql.vbs script is by default executed by the user “local system” that the checkmk agent is running with. In most cases this just works out-of-the-box.

If this does not work, you have at least three choices:

  1. Edit permissions for the local system account to connect to the database (see links)
  2. Enter database credentials for a database user (they will be stored in cleartext in the config files)
  3. change the logon account of the checkmk agent service to a user that has access to the database
  4. Maybe change the permissions of the plugin to a group user that has access to the database

Some info about the needed permissions :
https://kb.checkmk.com/display/KB/MSSQL+permissions
https://kb.checkmk.com/display/KB/Minimal+database+permissions+for+the+agent+plug-in+mssql.vbs

If you don´t know how to edit or find out how to set the necessary permissions, you should talk to the DBA of that system to help you.

As there is currently a huge bug in the code of the mssql.vbs, i would recommend to use 2.1p19 and in case of v2 wait for the 2.0p33, or use the newest versions from the git repo.

2 Likes

Thank you, I see that I need to copy plugin from ProgramFiles(x86)/checkmk/service/plugins to ProgramData/checkmk/agent/plugins, is it normal? it is how people do?

after copying plugin I see

Failed to connect to database (Connecting using provider msoledbsql. ERROR: Provider cannot be found. It may not be properly installed. Connecting using provider sqloledb. ERROR: Login failed for user ''. ERROR: Login failed for user ''. (SQLState: 42000/NativeError: 18456). Connecting using provider sqlncli11. ERROR: Login failed for user ''. ERROR: Login failed for user ''. (SQLState: 28000/NativeError: 18456).)CRIT, Version: 13.2.5026.0 - Express Edition

Monitored services (14)

Yes, that is correct, all plugins need to be in the plugins folder below programdata

What Version of checkmk are you using and what is the checkmk Agent Version ?

Did you try the latest script from the tribe29 github Repo?

1 Like

using 2.1.0p12, also tried 2.1.0p20 from repo. None worked.

seen this topic, not tried yet : MSSQLSERVER Login failed for user '' after upgrade - #11 by louis

Hard to tell, if the error message is caused by missing permissions or if the script is not working correctly, you can try the fix from the other blogpost, if that does not work you will have to adjust the database permissions for the user you are using.

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.