NT performance counter problem
NT performance counter problem
Hello,
First of all i have to say that hostmon is a greate software.
But i have a problem that i can't resolve.
I use hostmon to monitor a wide range of performance and avalibility counter. All counter types and checktype works fine but only the Perfmon Counter from NT works not properly.
The problem is that sometimes the perfmon counter are unknown. I had configured the the status unknown is not threaded as bad. But if the counter is going back to ok always the Good Action Event will thrown. I use SMS for sending messages. So everytime if the Status will change from unknown to good i will get a SMS.
I have tryed to supress the messages by useing the macro variable %laststatus% (execute external Programm) and if the last status is Unknown so i suppress sending messages, but the variable is everytimie NULL.
Please help
Mike
First of all i have to say that hostmon is a greate software.
But i have a problem that i can't resolve.
I use hostmon to monitor a wide range of performance and avalibility counter. All counter types and checktype works fine but only the Perfmon Counter from NT works not properly.
The problem is that sometimes the perfmon counter are unknown. I had configured the the status unknown is not threaded as bad. But if the counter is going back to ok always the Good Action Event will thrown. I use SMS for sending messages. So everytime if the Status will change from unknown to good i will get a SMS.
I have tryed to supress the messages by useing the macro variable %laststatus% (execute external Programm) and if the last status is Unknown so i suppress sending messages, but the variable is everytimie NULL.
Please help
Mike
Hello,
-----------------------------------
Note #2 (bugs): Windows implementation of performance counters has bugs. E.g., Windows 2000 (Professional, Server, and Advanced Server editions) can produce memory leak in Pdh.dll when user (application) querying performance counter that does not exist. This bug fixed in SP2. Also pdh.dll does not work correctly with multithread applications.
That's why in HostMonitor we have implemented several different methods to work with pdh.dll:
MultiThread mode: HostMonitor works almost according to Microsoft documentation with some workaround to avoid most likely problems. HM loads pdh.dll at once and uses it all the time. This method fast because HM can start several tests simultaneously. If everything will work correctly on your system, use this method (by default HostMonitor uses this method).
OneByOne mode: Using this method HM will start Performance Counter tests one by one and reload pdh.dll every time. This method slow (when you setup Performance Counter test using Test Properties dialog program even can hang for 1-2 min) but using this method you will avoid some problems due to a buggy pdh.dll
Smart mode: With this method HM will try to detect when pdh.dll need to be reloaded.
To change mode, add line "PerfWorkMode=N" to hostmon.ini file into [Misc] section and restart HostMonitor. N is number of the mode: 0 - MultiThread mode, 1 - OneByOne mode, 2 - Smart mode
-----------------------------------
Usually "OneByOne" mode helps in similar situations.
Regards
Alex
http://www.ks-soft.net/hostmon.eng/mfra ... #perfnotesI use hostmon to monitor a wide range of performance and avalibility counter. All counter types and checktype works fine but only the Perfmon Counter from NT works not properly.
The problem is that sometimes the perfmon counter are unknown
-----------------------------------
Note #2 (bugs): Windows implementation of performance counters has bugs. E.g., Windows 2000 (Professional, Server, and Advanced Server editions) can produce memory leak in Pdh.dll when user (application) querying performance counter that does not exist. This bug fixed in SP2. Also pdh.dll does not work correctly with multithread applications.
That's why in HostMonitor we have implemented several different methods to work with pdh.dll:
MultiThread mode: HostMonitor works almost according to Microsoft documentation with some workaround to avoid most likely problems. HM loads pdh.dll at once and uses it all the time. This method fast because HM can start several tests simultaneously. If everything will work correctly on your system, use this method (by default HostMonitor uses this method).
OneByOne mode: Using this method HM will start Performance Counter tests one by one and reload pdh.dll every time. This method slow (when you setup Performance Counter test using Test Properties dialog program even can hang for 1-2 min) but using this method you will avoid some problems due to a buggy pdh.dll
Smart mode: With this method HM will try to detect when pdh.dll need to be reloaded.
To change mode, add line "PerfWorkMode=N" to hostmon.ini file into [Misc] section and restart HostMonitor. N is number of the mode: 0 - MultiThread mode, 1 - OneByOne mode, 2 - Smart mode
-----------------------------------
Usually "OneByOne" mode helps in similar situations.
I think you are still using old version of HostMonitor. This behavior was changed in version 3.70. Version 3.71 and 4.10 available at www.ks-soft.net/hostmon.eng/downpage.htmI had configured the the status unknown is not threaded as bad. But if the counter is going back to ok always the Good Action Event will thrown.
Regards
Alex
Hello Alex,
I had installed 4.10 excellent new features. But 4.10 hasn't solved my problems.
1) I have still the Problem with the state unknow with PerfMon data. I had set all the settings in the Hostmon.ini but the problem is going bigger. So i had stoppt Alarming. (Overnight 118 notifications)
2) The Execute External Programm trigger will be trown in the case of the state change from unknown to OK.
3) I had tried to supress the SMS sending if Unknow changes to OK by checking the macrovariable %LastStatus%. The variable is NULL if the Status was unknown. If it was OK LastStatus ist OK.
Please help
Mike
I had installed 4.10 excellent new features. But 4.10 hasn't solved my problems.
1) I have still the Problem with the state unknow with PerfMon data. I had set all the settings in the Hostmon.ini but the problem is going bigger. So i had stoppt Alarming. (Overnight 118 notifications)
2) The Execute External Programm trigger will be trown in the case of the state change from unknown to OK.
3) I had tried to supress the SMS sending if Unknow changes to OK by checking the macrovariable %LastStatus%. The variable is NULL if the Status was unknown. If it was OK LastStatus ist OK.
Please help
Mike
Mike,
>1) I have still the Problem with the state unknow with PerfMon data. I had set all the settings in the Hostmon.ini but the problem is going bigger. So i had stoppt Alarming. (Overnight 118 notifications)
H'm, what Windows do you use? Service Pack?
>2) The Execute External Programm trigger will be trown in the case of the state change from unknown to OK.
My mistake, you are right. I just checked our history log and see behavior of the actions was changed one more time. Comment that I see in the log is "its possible to use 'depend on option'".
It means if you use "action depends on bad one" option of an action and make "good" SMS dependant on "bad" SMS, HostMonitor will not send "good" SMS in case "bad" SMS was not sent before.
>3) I had tried to supress the SMS sending if Unknow changes to OK by checking the macrovariable %LastStatus%. The variable is NULL if the Status was unknown. If it was OK LastStatus ist OK.
Could not reproduce this problem. What action do you use to send SMS? What exactly condition do you use to start an action?
Or you do not use "advaced mode" to send "good" SMS but use some external filter that checks SMS message?
Regards
Alex
>1) I have still the Problem with the state unknow with PerfMon data. I had set all the settings in the Hostmon.ini but the problem is going bigger. So i had stoppt Alarming. (Overnight 118 notifications)
H'm, what Windows do you use? Service Pack?
>2) The Execute External Programm trigger will be trown in the case of the state change from unknown to OK.
My mistake, you are right. I just checked our history log and see behavior of the actions was changed one more time. Comment that I see in the log is "its possible to use 'depend on option'".
It means if you use "action depends on bad one" option of an action and make "good" SMS dependant on "bad" SMS, HostMonitor will not send "good" SMS in case "bad" SMS was not sent before.
>3) I had tried to supress the SMS sending if Unknow changes to OK by checking the macrovariable %LastStatus%. The variable is NULL if the Status was unknown. If it was OK LastStatus ist OK.
Could not reproduce this problem. What action do you use to send SMS? What exactly condition do you use to start an action?
Or you do not use "advaced mode" to send "good" SMS but use some external filter that checks SMS message?
Regards
Alex
Wow. I'd love to try it. We have similar ProblemsWooltown wrote:I have an updated PDH.DLL from Microsoft (Post SP4), I can mail it to you if you like.
Sven

If you could mail it to me.
thx
René
Last edited by M@ster on Wed Oct 01, 2003 4:40 am, edited 1 time in total.
Hello Alex.
H'm, what Windows do you use? Service Pack?
On the Monitor machine works Win 2000 SP3 Prof. On the monitored machnies Win2000 SP3 Server
Could not reproduce this problem. What action do you use to send SMS? What exactly condition do you use to start an action?
Or you do not use "advaced mode" to send "good" SMS but use some external filter that checks SMS message?
In a good or bad case a external program will be executed. Here is the commadline.
D:\hostmon\Tools\CreateMessage.cmd MyZellPhoneNo "%CommentLine1%" "%CommentLine1%" "%status%" D:\sms\out\Wag_%CommentLine2%_BAD_message.xml "%LastStatus%" 2>>d:\sms\Wag_messages.log
I had create also a debug script which dumps the %Laststatus% in a logfile and i can see that only OK or Host is alive states will be logged but for the state unknown the LastStatus is everytime NULL
Mike
H'm, what Windows do you use? Service Pack?
On the Monitor machine works Win 2000 SP3 Prof. On the monitored machnies Win2000 SP3 Server
Could not reproduce this problem. What action do you use to send SMS? What exactly condition do you use to start an action?
Or you do not use "advaced mode" to send "good" SMS but use some external filter that checks SMS message?
In a good or bad case a external program will be executed. Here is the commadline.
D:\hostmon\Tools\CreateMessage.cmd MyZellPhoneNo "%CommentLine1%" "%CommentLine1%" "%status%" D:\sms\out\Wag_%CommentLine2%_BAD_message.xml "%LastStatus%" 2>>d:\sms\Wag_messages.log
I had create also a debug script which dumps the %Laststatus% in a logfile and i can see that only OK or Host is alive states will be logged but for the state unknown the LastStatus is everytime NULL
Mike
HostMonitor does not execute action when status is "unknown" and "treat unknown status as bad" option is disabled.I had create also a debug script which dumps the %Laststatus% in a logfile and i can see that only OK or Host is alive states will be logged but for the state unknown the LastStatus is everytime NULL
Regards
Alex
Michael,
1) No "unknown" status in the log.
You don't see it because HostMonitor does not start action. HostMonitor does not start action because "Treat unknown status as bad" option is disabled.
As I understand you don't realy need this status in the log and use it just for testing. Right? So, no problem here.
2) HostMonitor executes "good" action when status changes from "Unknown" to "Ok"
Use "Action depends on bad one" property of the "good" action to avoid this.
Regards
Alex
Yes, I understand. But we are talking about 2 different problems:The option Thread unkonwn as bad is disabled. If the Status unknow occurs the Bad Acticon will not executed but if the status change from unknown the OK or Host is alive then the Good Action will be executed.
1) No "unknown" status in the log.
You don't see it because HostMonitor does not start action. HostMonitor does not start action because "Treat unknown status as bad" option is disabled.
As I understand you don't realy need this status in the log and use it just for testing. Right? So, no problem here.
2) HostMonitor executes "good" action when status changes from "Unknown" to "Ok"
Use "Action depends on bad one" property of the "good" action to avoid this.
Regards
Alex