Ad Widget

Collapse

User Quota monitoring for windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karzer
    Member
    • Mar 2010
    • 61

    #1

    User Quota monitoring for windows

    Hi,

    We want to keep track of users' quota, what can we do?
    System : windows 2003 server

    This is my command "quota fsutil query d:" I know how to adapt to zabbix?
  • sarathyme
    Member
    • Mar 2009
    • 58

    #2
    You can use the user parameters.

    e.g.
    UserParameter=quota[*],fsutil quota query $1

    and setting up item key like quote[c:]

    Regards
    Vijay

    Comment

    • ruswold
      Senior Member
      • Mar 2010
      • 210

      #3
      Originally posted by karzer
      Hi,

      We want to keep track of users' quota, what can we do?
      System : windows 2003 server

      This is my command "quota fsutil query d:" I know how to adapt to zabbix?
      Try this:
      1. your command should be "fsutil quota query d:"
      2. in zabbix agent add string
      UserParameter=check.quota,quota fsutil query d:
      3. create item with key check.quota as active agent (active)

      or you may create script
      Code:
      strComputer = "."
      Set objWMIService = GetObject("winmgmts:" _
          & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
      
      Set colQuotas = objWMIService.ExecQuery _
          ("Select * From Win32_DiskQuota Where " & _
              "User='Win32_Account.Domain=""domain"",Name=""username""'")
          
      For Each objQuota in colQuotas
          'Wscript.Echo "Disk Space Used: " & objQuota.DiskSpaceUsed
          'Wscript.Echo "Limit: " & objQuota.Limit 
          'Wscript.Echo "Quota Volume: " & objQuota.QuotaVolume  
         
          intStatus = objQuota.Status 
          Select Case intStaus 
              Case 0 
                  strStatus = "OK"
              Case 1
                  strStatus = "Warning limit reached"
              Case 2
                  strStatus = "Quota exceeded"
              Case Else
                  strStatus = "Unknown"
           End Select
      
          Wscript.Echo "Status: " & strStatus 
          'Wscript.Echo "Warning Limit: " & objQuota.WarningLimit
      Next
      1. Save as quota.vbs
      2. in zabbix agent add string
      UserParameter=check.quota,quota.vbs //nologo
      3. create item with key check.quota as active agent (active)

      Script may return many values, current - return status quota of user domain\username

      Comment

      • karzer
        Member
        • Mar 2010
        • 61

        #4
        Thank you for your reply.
        But the data does not come ...


        ITEM

        Description : quota
        Type : ZABBIX AGENT (active)
        Key : check.quota

        userparametre : UserParameter=check.quota,quota.vbs //nologo
        Last edited by karzer; 28-07-2010, 12:38.

        Comment

        • ruswold
          Senior Member
          • Mar 2010
          • 210

          #5
          Originally posted by karzer
          Thank you for your reply.

          userparametre : UserParameter=check.quota,quota.vbs //nologo
          1. Save script to path like c:\quota.vbs
          2. Set UserParameter=check.quota,cscript c:\quota.vbs //nologo
          3. Restart zabbix agent service

          Comment

          • karzer
            Member
            • Mar 2010
            • 61

            #6
            But the data does not come ...

            My Zabbix version 1.6.8. Seemed to me like the script does not run.
            Where a script needs changing, or do you have?
            Last edited by karzer; 28-07-2010, 23:08.

            Comment

            • ruswold
              Senior Member
              • Mar 2010
              • 210

              #7
              Originally posted by karzer
              But the data does not come ...

              My Zabbix version 1.6.8. Seemed to me like the script does not run.
              Where a script needs changing, or do you have?
              1. Run directly script on windows machine. It must return value.
              2. Check status of item (active or unsupported)
              3. see log zabbix server and agent.

              Comment

              • karzer
                Member
                • Mar 2010
                • 61

                #8
                When I ran the script, something happens

                This stems from sql query
                Code:
                 ("Select * From Win32_DiskQuota Where " & _
                        "User='Win32_Account.Domain=""domain"",Name=""username""'")
                I was over the limit I'd like to see all users


                Status of item active


                Zabbix agent log

                Code:
                17776:20100728:133320 zabbix_agentd started. ZABBIX 1.6.8 (revision 8542).
                 38632:20100728:133320 zabbix_agentd collector started
                 18300:20100728:133320 zabbix_agentd listener started
                  7576:20100728:133320 zabbix_agentd listener started
                 50140:20100728:133320 zabbix_agentd listener started
                 27944:20100728:133320 zabbix_agentd active check started [10.192.100.8:10051]
                 27944:20100728:133339 Active check [check.quota] is not supported. Disabled.
                 27944:20100728:133556 Active check [check.quota] is not supported. Disabled.
                  27944:20100728:134356 Active check [check.quota] is not supported. Disabled.
                 27944:20100728:140952 Active check [check.quota] is not supported. Disabled.
                 27944:20100728:141231 zabbix_agentd active check stopped
                Last edited by karzer; 29-07-2010, 11:04.

                Comment

                Working...