I make a solution for Windows mount points monitoring.
Task
Monitor a free spase (in bytes and %) for any windows mount point
at Win2008 R2 (MS Cluster).
Solution
Get your mounted points Caption (get it from WMI by query "select * from Win32_Volume"):
We will use for example the mountpoint T:\Users\Profiles
At Windows Server side
* Create subdirectory in zabbix agent directory, call it Scripts (C:\Progra~1\Zabbix)
* Create a powershell script disk_data.ps1, plase here (C:\Progra~1\Zabbix\Scripts\disk_data.ps1)
(Note: i use Progra~1 as short format of Program Files directory)
Script code:
* Allow execution for ps1 unsigned scripts at powershell console
At Zabbix side
* Create an Item
Description: MountPoint T:\Users\Profiles - size
Type: Zabbix Agent
Key:
Type of information: Numeric (unsigned)
Data type: Decimal
Units: B
Store\Show value: As is
* Create an Item
Description: MountPoint T:\Users\Profiles - free (in bytes)
Type: Zabbix Agent
Key:
Type of information: Numeric (unsigned)
Data type: Decimal
Units: B
Store\Show value: As is
* Create an Item
Description: MountPoint T:\Users\Profiles - free (in %)
Type: Calculated
Key:
Type of information: Numeric (unsigned)
Data type: Decimal
Units: %
Store\Show value: As is
I think, you can create triggers by yourself.
Thats all, folks =)
Task
Monitor a free spase (in bytes and %) for any windows mount point
at Win2008 R2 (MS Cluster).
Solution
Get your mounted points Caption (get it from WMI by query "select * from Win32_Volume"):
We will use for example the mountpoint T:\Users\Profiles
At Windows Server side
* Create subdirectory in zabbix agent directory, call it Scripts (C:\Progra~1\Zabbix)
* Create a powershell script disk_data.ps1, plase here (C:\Progra~1\Zabbix\Scripts\disk_data.ps1)
(Note: i use Progra~1 as short format of Program Files directory)
Script code:
Code:
param ($caption, $info)
gwmi win32_volume|where-object {$_.name -match “$caption”}| % { '{0,10}' -f $_.$info}
At Zabbix side
* Create an Item
Description: MountPoint T:\Users\Profiles - size
Type: Zabbix Agent
Key:
Code:
system.run["powershell.exe -NoProfile -NoLogo -File C:\Progra~1\Zabbix\Scripts\disk_data.ps1 T:\\Users\\Profiles Capacity"]
Data type: Decimal
Units: B
Store\Show value: As is
* Create an Item
Description: MountPoint T:\Users\Profiles - free (in bytes)
Type: Zabbix Agent
Key:
Code:
system.run["powershell.exe -NoProfile -NoLogo -File C:\Progra~1\Zabbix\Scripts\disk_data.ps1 T:\\Users\\Profiles Freespace"]
Data type: Decimal
Units: B
Store\Show value: As is
* Create an Item
Description: MountPoint T:\Users\Profiles - free (in %)
Type: Calculated
Key:
Code:
100*last(system.run["powershell.exe -NoProfile -NoLogo -File C:\Progra~1\Zabbix\Scripts\disk_data.ps1 T:\\Users\\Profiles Freespace"])/last(system.run["powershell.exe -NoProfile -NoLogo -File C:\Progra~1\Zabbix\Scripts\disk_data.ps1 T:\\Users\\Profiles Capacity"])
Data type: Decimal
Units: %
Store\Show value: As is
I think, you can create triggers by yourself.
Thats all, folks =)
Comment