Ad Widget

Collapse

Monitor availability of SMB Shares

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cwo
    Junior Member
    • Mar 2025
    • 1

    #1

    Monitor availability of SMB Shares

    Hi all.

    I am using Zabbix 7.2.4 and trying to monitor the availability of SMB shares (not assigned drives like C, D or E,... from logged in user - I'd like to monitor local shares like \\<hostname>\<sharename>) from my Windows Server, running Agent 2.

    What I currently have:

    A Windows server 2019, running latest Zabbix Agent 2, connected to Zabbix Server 7.2.4. I see values coming in from the agent.

    On this Windows server, a small batch script enumerates all network shares (via "net view \\%COMPUTERNAME% /all"), the output is a line-by-line list of shares of the local host like this:

    \\<hostname>\<share1>
    \\<hostname>\<share2>
    \\<hostname>\<share3>
    ...and so on...

    Within the zabbix_agent2.conf, I then defined a UserParameter "NetworkShares" and added this as a new item to the host within the Zabbix-Server. There, I see the list of shares within Zabbix, so the script works and sends data to the Zabbix server.

    But here I need some help:

    How can I transform the list within Zabbix into to a function like

    vfs.fs.size["\\<hostname>\<share1>",pfree]
    vfs.fs.size["\\<hostname>\<share2>",pfree]
    ...and so on...

    A list of all shares is nice, but I want to get a trigger to -each- share, alerting me, when it is not available.

    Best regards,

    Christian
Working...