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
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
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!
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
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()
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!
Comment