Hi,
I'm new to zabbix.
I have a powershell script that gives me all databases in a specific sqlserver instance with its size, how much of the datafile is free etc.
This information is provided in JSON format.
I have created a userparameter in the agent config file on the target host and restarted the zabbix agent on the host (Windows).
In the frontend of zabbix I would like to create an itemprototype that collects the size of the database ( and maybe other itemprototypes to collect the other data that the JSON output from the database server provides).
Then based on that Itemprototype I want to create a triggerprototype that signals me when the database had too little space left ( smaller than 10GB for example).
My userparameter looks like this:
UserParameter=mssql.filesize,powershell -NoProfile -ExecutionPolicy Bypass -File "C:\scripts\monitoring_db_sizes.ps1"
The output looks like this:
{
"{#SQLSERVER.HostName}": "HOST1",
"{#SQLSERVER.Instance}": "INSTANCE1",
"{#SQLSERVER.DBName}": "database1",
"{#SQLSERVER.DBSizeGB}": 30,
"{#SQLSERVER.DataFilesSizeGB}": 30,
"{#SQLSERVER.DataFilesFreeGB}": 20,
"{#SQLSERVER.DataFilesUsedGB}": 10,
"{#SQLSERVER.LogFilesSizeGB}": 100,
"{#SQLSERVER.LogFilesUsedGB}": 10,
"{#SQLSERVER.LogFilesFreeGB}": 0,
}
{
"{#SQLSERVER.HostName}": "HOST1",
"{#SQLSERVER.Instance}": "INSTANCE2",
"{#SQLSERVER.DBName}": "database1",
"{#SQLSERVER.DBSizeGB}": 30,
"{#SQLSERVER.DataFilesSizeGB}": 35,
"{#SQLSERVER.DataFilesFreeGB}": 20,
"{#SQLSERVER.DataFilesUsedGB}": 10,
"{#SQLSERVER.LogFilesSizeGB}": 100,
"{#SQLSERVER.LogFilesUsedGB}": 10,
"{#SQLSERVER.LogFilesFreeGB}": 0,
}
My item key looks like this:
mssql.filesize[{#SQLSERVER.DataFilesFreeGB}]
My trigger expression looks like:
{dba_sqlserver_template_marian:mssql.filesize[{#SQLSERVER.DataFilesFreeGB}].last(#5,300s)}<10
What am I doing wrong.
Could someone please help me?
Thanks in advance.
Regards,
Marian
I'm new to zabbix.
I have a powershell script that gives me all databases in a specific sqlserver instance with its size, how much of the datafile is free etc.
This information is provided in JSON format.
I have created a userparameter in the agent config file on the target host and restarted the zabbix agent on the host (Windows).
In the frontend of zabbix I would like to create an itemprototype that collects the size of the database ( and maybe other itemprototypes to collect the other data that the JSON output from the database server provides).
Then based on that Itemprototype I want to create a triggerprototype that signals me when the database had too little space left ( smaller than 10GB for example).
My userparameter looks like this:
UserParameter=mssql.filesize,powershell -NoProfile -ExecutionPolicy Bypass -File "C:\scripts\monitoring_db_sizes.ps1"
The output looks like this:
{
"{#SQLSERVER.HostName}": "HOST1",
"{#SQLSERVER.Instance}": "INSTANCE1",
"{#SQLSERVER.DBName}": "database1",
"{#SQLSERVER.DBSizeGB}": 30,
"{#SQLSERVER.DataFilesSizeGB}": 30,
"{#SQLSERVER.DataFilesFreeGB}": 20,
"{#SQLSERVER.DataFilesUsedGB}": 10,
"{#SQLSERVER.LogFilesSizeGB}": 100,
"{#SQLSERVER.LogFilesUsedGB}": 10,
"{#SQLSERVER.LogFilesFreeGB}": 0,
}
{
"{#SQLSERVER.HostName}": "HOST1",
"{#SQLSERVER.Instance}": "INSTANCE2",
"{#SQLSERVER.DBName}": "database1",
"{#SQLSERVER.DBSizeGB}": 30,
"{#SQLSERVER.DataFilesSizeGB}": 35,
"{#SQLSERVER.DataFilesFreeGB}": 20,
"{#SQLSERVER.DataFilesUsedGB}": 10,
"{#SQLSERVER.LogFilesSizeGB}": 100,
"{#SQLSERVER.LogFilesUsedGB}": 10,
"{#SQLSERVER.LogFilesFreeGB}": 0,
}
My item key looks like this:
mssql.filesize[{#SQLSERVER.DataFilesFreeGB}]
My trigger expression looks like:
{dba_sqlserver_template_marian:mssql.filesize[{#SQLSERVER.DataFilesFreeGB}].last(#5,300s)}<10
What am I doing wrong.
Could someone please help me?
Thanks in advance.
Regards,
Marian
Comment