View Full Version : Perfcounter values from M$ SQL
erisan500
18-08-2005, 00:55
Hi all,
is anyone monitoring an M$ SQL server?
I tried to use the following but without succes:
PerfCounter= SQLServer[Connections], "\SQLServer:General Statistics()\User Connections",5
I'm not sure about the () because when you add the counter in perfmon, the right column is empty and perfmon itself shows under instance ---
Any thoughts ?
Thanks in advance
Hello erisan500,
My experience with Zabbix is limited, but this is what I've found out on how to monitor any item that you can monitor using Windows Performance Monitor. To set this up, and get everything in the correct location, open your zabbix_agentd.conf file and at the bottom add a line similar to this:
PerfCounter= PrivilegedTime,"\Processor(_Total)\% Privileged Time",5
Open Performance monitor and add the counters you want to monitor (this is only done so you can see which items go where in the conf file). When viewing performance monitor the line in your conf file breaks down like this:
PerfCounter=ItemKeyUsedOnZabbixServer,"\Object(Instance)\Counter",HowOftenToCheckInSeconds
After you've done this, go to your zabbix server and add an item with the key name of whatever you typed in for the "ItemKeyUsedOnZabbixServer".
I hope this helps, :)
--AB
erisan500
19-08-2005, 21:13
Thanks for the reply, but i'm monitoring succesfully various performance counters. The problem was that when under instance there is "---".
Anyway, for those who have the same problem, you need to use () in case instance is "---"
Thanks EriSan
Sorry for the non-answer erisan500, you are correct, for an instance of --- just enter it as blank (). One more thing to note, if you are running SQL Server 2000 sp3a (maybe previous service packs as well) and you have performance counters running using zabbix (or other applications as well, including the windows performance monitor) and you restart sqlserver, you will lose your counters, meaning they completely dissappear. This is a known bug, the workaround is to stop all SQL Server performance monitors before restarting the SQL services. The fix is SQL Server 2000 SP4.
Thanks,
--AB
navtek007
04-10-2005, 04:44
What about when the instance is just blank eg no "---". For example what would you put if you wanted to monitor the following performance counter:
"\Memory\Page Faults/sec"
I have tried adding () but that doesn't work. I only get a value of 0 whatever method i try.
Any ideas?
Thanks.
erisan500
04-10-2005, 10:21
I's using such a counter with success:
perf_counter[\Memory\Committed Bytes]
so in your case that would be: perf_counter[\Memory\Page Faults/sec]
Greetings EriSan
navtek007
05-10-2005, 00:58
are you adding this to the config file on teh server or adding a new item in zabbix?
thanks.
that particular syntax would be a new item for the host in zabbix
navtek007
05-10-2005, 12:59
thats strange because either way i still get a value of 0. Am i doing something wrong? When i do try and add it via the zabbix interface it reformats the key to read the following:
perf_counter[\\Memory\\Page Faults/sec]
this doesn't seem right.
It's not, and that is probably your problem.
there is a bug somewhere around here where somebody brought the double backslash issue to Alexei's attention.
navtek007
06-10-2005, 01:22
do you know if there is a way around it? or do u have to modify the key manually in mysql?
bytesize
06-10-2005, 12:25
Hi,
Edit your php.ini and change make sure the values below are set to Off:
magic_quotes_gpc = Off
magic_quotes_runtime = Off
Restart apache, then edit the items so your perf_counter only has one backslash. Click "Update" and hey presto, it should work!
If not, try deleting the item and re-adding it again. If it works, the item will only show one backslash in the host items listing.
Regards,
John
chocho63
07-10-2005, 11:08
The problem of '//' is resolved on the forum. You have to add the following lines to php.ini :
magic_quotes_gpc = Off
magic_quotes_runtime = Off
But the counter still returns a value of 0 with Zabbix_Agent (perf_counter), although the value is good from zabbix_agentd.conf (with perfcounter = ).