Using the 64-bit Zabbix 2.0.5 agent on a Windows 2008 R2 Standard server running Application Request Routing (ARR), I am attempting to use the "perf_counter" item to retrieve the following counter from Windows:
\Application Request Routing Server(_Total)\Average Response Time / Request
When I use perf_counter[\Application Request Routing Server(_Total)\Average Response Time / Request], the value returned is always 100.00...yet I can go into perfmon on the server in question and see the true value (which is the average response time for requests across all underlying servers in milliseconds).
After significant debug, I could not determine whether the issue was one of 32-bit versus 64-bit counters (likely), or whether there is a true bug in the Zabbix code (unlikely). Thus, I created a PowerShell script, named arr_tot_avg_resp_time_req.ps1, with the following code:
- - - -
$array_temp=Get-Counter -Counter "\Application Request Routing Server(_Total)\Average Response Time / Request" -MaxSamples 2 -SampleInterval 1
[String]$var=$array_temp[0].countersamples|Select-Object -ExpandProperty CookedValue
echo $var
- - - -
Then, in zabbix_agentd.conf on the server in question, I set:
UserParameter=ARRTotAvgRespTimeReq,powershell -File "C:\Program Files\Zabbix\arr_tot_avg_resp_time_per_req.ps1"
...then set my key value to ARRTotAvgRespTimeReq in the item, restarted the agent on the server in question, and all works.
While the above is a solution, I hate to load PowerShell every 30 seconds just to count a single value. Is there a way under Zabbix that works to retrieve the counter? Alternatively, is there something I can do as a workaround that uses the Zabbix agent versus home-grown code?
Thank you in advance for any comments.
\Application Request Routing Server(_Total)\Average Response Time / Request
When I use perf_counter[\Application Request Routing Server(_Total)\Average Response Time / Request], the value returned is always 100.00...yet I can go into perfmon on the server in question and see the true value (which is the average response time for requests across all underlying servers in milliseconds).
After significant debug, I could not determine whether the issue was one of 32-bit versus 64-bit counters (likely), or whether there is a true bug in the Zabbix code (unlikely). Thus, I created a PowerShell script, named arr_tot_avg_resp_time_req.ps1, with the following code:
- - - -
$array_temp=Get-Counter -Counter "\Application Request Routing Server(_Total)\Average Response Time / Request" -MaxSamples 2 -SampleInterval 1
[String]$var=$array_temp[0].countersamples|Select-Object -ExpandProperty CookedValue
echo $var
- - - -
Then, in zabbix_agentd.conf on the server in question, I set:
UserParameter=ARRTotAvgRespTimeReq,powershell -File "C:\Program Files\Zabbix\arr_tot_avg_resp_time_per_req.ps1"
...then set my key value to ARRTotAvgRespTimeReq in the item, restarted the agent on the server in question, and all works.
While the above is a solution, I hate to load PowerShell every 30 seconds just to count a single value. Is there a way under Zabbix that works to retrieve the counter? Alternatively, is there something I can do as a workaround that uses the Zabbix agent versus home-grown code?
Thank you in advance for any comments.