Ad Widget

Collapse

Monitoring user quota in windows server 2003

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thuongnv
    Junior Member
    • Feb 2011
    • 10

    #1

    Monitoring user quota in windows server 2003

    Hi all!

    I'm trying to monitor user quota in windows server 2003 but i meet som problem. I have read a guide in forum and this is my all step:

    1. I create an vb script named quota.vbs and i save it to patch C:\quota.vbs on windows server 2003
    Here is the script
    Code:
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    
    Set colDiskQuotas = objWMIService.ExecQuery("Select * from Win32_DiskQuota")
    Dim a
    a = 0
    For each objQuota in colDiskQuotas
    
    intstatus = objQuota.Status
    	If intstatus = 1 Then 
    		a = 1
    	ElseIf intstatus = 2 Then
    		a = 2
    		Exit For
    	End If
    
    Next
    Wscript.Echo a
    2, I add string UserParameter in file zabbix_agentd.win.conf of windows server 2003 like this
    UserParameter=check.quota,script c:\quota.vbs //nologo

    3, I create an items on zabbix with
    Key: check.quota
    Type: Zabbix agent (Active)
    But when Zabbix check it report in log in zabbix_agent.log on windows server 2003 like this
    Code:
    2728:20110501:111600.250 Values in the buffer 0 Max 100
      2728:20110501:111600.250 In process_active_checks('10.0.0.10',10051)
      2728:20110501:111600.266 Before
      2728:20110501:111600.266 Run remote command [cmd /C "script c:\quota.vbs //nologo"] Result [95] ['script' is not reco]...
      2728:20110501:111600.266 For key [check.quota] received value ['script' is not recognized as an internal or external command,
    operable program or batch file.]
      2728:20110501:111600.266 In process_value('DomainController','check.quota',''script' is not recognized as an internal or external command,
    operable program or batch file.')
      2728:20110501:111600.266 In send_buffer('10.0.0.10','10051')
      2728:20110501:111600.266 Values in the buffer 0 Max 100
      2728:20110501:111600.266 Buffer: new element 0
      2728:20110501:111600.266 In get_min_nextcheck()
      2728:20110501:111600.266 Sleeping for 1 seconds
      1700:20110501:111600.734 In collect_cpustat()
      2728:20110501:111601.266 In send_buffer('10.0.0.10','10051')
      2728:20110501:111601.266 Values in the buffer 1 Max 100
      2728:20110501:111601.266 JSON before sending [{
    	"request":"agent data",
    	"data":[
    		{
    			"host":"DomainController",
    			"key":"check.quota",
    			"value":"'script' is not recognized as an internal or external command,\r\noperable program or batch file.",
    			"clock":1304223360}],
    	"clock":1304223361}]
      2728:20110501:111601.531 JSON back [{
    	"response":"success",
    	"info":"Processed 0 Failed 1 Total 1 Seconds spent 0.014801"}]
      2728:20110501:111601.531 In check_response({
    	"response":"success",
    	"info":"Processed 0 Failed 1 Total 1 Seconds spent 0.014801"})
      2728:20110501:111601.531 Info from server: Processed 0 Failed 1 Total 1 Seconds spent 0.014801
      2728:20110501:111601.531 OK
      2728:20110501:111601.531 Sleeping for 1 seconds
      1700:20110501:111601.734 In collect_cpustat()
    So plz everybody help me.
    I run the script quota.vbs directly on windows server 2003 and it return value
    0: If diskquota is ok
    1: If diskquota is warning limit
    2: If Quota is exceeded

    Plz help me, thanks in advance, sorry for my bad english!
    Last edited by thuongnv; 01-05-2011, 06:21.
  • thuongnv
    Junior Member
    • Feb 2011
    • 10

    #2
    Up, help me please

    Comment

    • thuongnv
      Junior Member
      • Feb 2011
      • 10

      #3
      Please help me!
      I really need your help, i have to monitor disk quota so help me please

      Comment

      • Rudd
        Member
        • Mar 2011
        • 69

        #4
        Disclaimer upfront, I don't know anything about Windows quota or vbs. But, based on the following error messages in your log file, I hazard a guess that the command "script" is not in your PATH. Try adding it to the system PATH or prefix the user parameter appropriately.

        Originally posted by thuongnv
        2728:20110501:111600.266 Run remote command [cmd /C "script c:\quota.vbs //nologo"] Result [95] ['script' is not reco]...
        2728:20110501:111600.266 For key [check.quota] received value ['script' is not recognized as an internal or external command,
        operable program or batch file.]
        hth,..

        Comment

        • thuongnv
          Junior Member
          • Feb 2011
          • 10

          #5
          Hi Rudd!
          Thanks for your help!
          I have just corrected my problem. My UserParameter is wrong, it should be "UserParameter=check.quota,cscript c:\quota.vbs //nologo"

          Regard,
          thuongnv

          Comment

          Working...