zabbix / community-templates

Zabbix Community Templates repository
https://share.zabbix.com
MIT License
1.41k stars 1.82k forks source link

2 Microsoft SQL templates appear to be missing information #41

Closed MatthewSteeves closed 3 months ago

MatthewSteeves commented 2 years ago

template_app_ms_sql_databasediscovery(lld) references key: windowsdb.discovery template_app_ms_sql_instancediscovery(lld) references key: windowssqlinstances.discovery

These are not agent or agent2 built-in keys. Therefore there must have been additional scripts or at least user parameters that would need to be defined. These templates should be marked as incomplete, or the additional information added.

I tried searching for more info using:

RangersMS commented 2 years ago

Hi, I'm having the same issue right now. Tested it with Zabbix Agent 2 5.0.24 and 6.0.5.

ablecable commented 2 years ago

I'm also having the same issue

chi110r commented 1 year ago

I faced the same issue and reversed engineered the discovery for the instances discovery for our Infrastructure.

$services = Get-Service "mssql$*"|Select-Object -ExpandProperty Name
$data = foreach ($service in $services) {
    [PSCustomObject]@{
        "{#INSTANCES}" = $service
    }
}

$data|ConvertTo-Json
UserParameter=windowssqlinstances.discovery[*],powershell.exe -command "& '%programfiles%\Zabbix\scripts\windowssqlinstances.ps1'"

I don't know if the instance names always match the name of the service, as they do at my company.

side note: i had to add/change the discovery filter to a marco, like this:

{$MSSQL.MULTI.INSTANCE.MATCHAES} = ".*" for match

Georg311 commented 1 year ago

I faced the same issue and reversed engineered the discovery for the instances discovery for our Infrastructure.

$services = Get-Service "mssql$*"|Select-Object -ExpandProperty Name
$data = foreach ($service in $services) {
    [PSCustomObject]@{
      "{#INSTANCES}" = $service
  }
}

$data|ConvertTo-Json
UserParameter=windowssqlinstances.discovery[*],powershell.exe -command "& '%programfiles%\Zabbix\scripts\windowssqlinstances.ps1'"

I don't know if the instance names always match the name of the service, as they do at my company.

side note: i had to add/change the discovery filter to a marco, like this:

{$MSSQL.MULTI.INSTANCE.MATCHAES} = ".*" for match

I was able to reproduce / fix it the way you described

Georg311 commented 1 year ago

I've created a Pull Request Draft, (Only for version 6.0 and Instance) Please @chi110r check if it is like you added. If so i can add the other files to the PR. And maybe afterwards we get somebody to approve it :)