Test not work under Win2008, when Hostmon run as service

When you post information about some problem, please include the following details: - OS version (e.g. Windows 2000 Professional SP3); HostMonitor version; problem description.
PwUser
Posts: 12
Joined: Sat May 15, 2010 10:22 am

Test not work under Win2008, when Hostmon run as service

Post by PwUser »

Hi,
I'm installed the trial version of Hostmon 8.58 for examination.
I've found, that your powerfull prog does not support very simple feature - it unable perform TCP Connection test!!!! I'm only need to know - can I establish TCP connection on some port of the remote host, or not! Your program always wait for reply from remote service, but cannot define the fact, that connection is established. I have been compelled to write the bat file, which use PortQry utility from M$ to determine the port state. That bat file returns an error by setting eviromental variable ERRORLEVEL
Here is the my bat file:

Code: Select all

@echo off
portqry.exe -n host.domain.com -e 1935|find /C "NOT LISTENING"|find "0"|| exit /B 3
After that I'm convert it to exe file and point it for TCP Connection test.
It works perfectly, when I run Hostmon under my account. But when I'm run this test under hostmon, which installed as service it returns "Unknown" state for test result. Is it bug or the feature of your program? Can you provide me with example of code, which can pass error code to Hostmon correctly?
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

TCP test works fine on any Windows.
What exactly port do you check? Do you use "Send data" option?
Do you have installed some antivirus monitors, personal firewall, content monitoring software? Non stanard winsock components?

Regards
Alex
PwUser
Posts: 12
Joined: Sat May 15, 2010 10:22 am

Post by PwUser »

I'm do not want to use "Send data" option at all! The only what I need - to determine, can I establish connection to the port of the remote host or not?
Lets imagine, that I'm try to monitor HTTPS port - which data I'm must to send to this port, that I can receive the reply from this port? It is difficult to do this for HTTPS!
Look for ServersAlive - it has such option, that called Port Connector (Just connects to port and if it can be done - UP). Why you don't include this kind of test in your program? It very simple and very useful.
PwUser
Posts: 12
Joined: Sat May 15, 2010 10:22 am

Post by PwUser »

Also I have a troubles with certificates under Win 2008 - I'm try to do HTTPS check of some site, which require user certificate. I'm unable to choose any certificate, which installed on Computer or User certification store - your program shows empty list of certificates!
BTW - I'm run hostmon.exe as administrator :)
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I'm do not want to use "Send data" option at all!
So, what is the problem? If you do not want to use this option, do not use it.
By default this option is not marked.
The only what I need - to determine, can I establish connection to the port of the remote host or not?
Again, I do not see any problem. Just specify target host, port and timeout and test is ready.

Regards
Alex
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Also I have a troubles with certificates under Win 2008 - I'm try to do HTTPS check of some site, which require user certificate. I'm unable to choose any certificate, which installed on Computer or User certification store - your program shows empty list of certificates!
May be certificate is not marked as client certificate?
There is near by thread with solution http://www.ks-soft.net/cgi-bin/phpBB/vi ... php?t=5681

Regards
Alex
PwUser
Posts: 12
Joined: Sat May 15, 2010 10:22 am

Post by PwUser »

Again, I do not see any problem. Just specify target host, port and timeout and test is ready.
:) It will be so simple. When I do this, your program shows, that host is alive. But I need, that I'm receive notification by e-mail, when host will be unavialable. And in that case your program waiting for REPLY from port, not connection (I'm unable choose from conditions list anything, that differs from reply - here is "no reply", "any reply" etc..)!!!!
PwUser
Posts: 12
Joined: Sat May 15, 2010 10:22 am

Post by PwUser »

KS-Soft wrote: May be certificate is not marked as client certificate?
There is near by thread with solution http://www.ks-soft.net/cgi-bin/phpBB/vi ... php?t=5681
Thank you, it works!
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Quote from the manual
===============
Alert when
To check the reply from the server, mark this option and choose one of the conditions to consider result of the test as "Bad":
===============
If you want to check just TCP connection, simply keep this option unmarked. If you keep default test settings ("Alert when" option is disabled), HostMonitor will check TCP connection only.

Regards
Alex
PwUser
Posts: 12
Joined: Sat May 15, 2010 10:22 am

Post by PwUser »

Wow, it works! Thank you, Alex!!
Btw, but i'm found another bug.
Step to reproduce:
1. Let we try to monitor some HTTPS server, running on non-standard port (8080 for example). This server require user sertificate, that is not marked as client certificate.
I do changes in hostmon.ini - add FilterClientCertificates=0 and UseLocalCertStore=1, import client certificate both to computer and my account certification store. Alert settings - to send my e-mail, when 1 consecutive "Bad" results occur and repeat 3 times. Also send me e-mail, when 1 consecutive "Good" results occur, repeat 1 time.
2. I've installed hostmon as service, running under another user account, that has domain admin rights
3. I'm create bat file, that pointed in manual, that i can interact with GUI of service under Win 2008.
4. Run this file as administrator
5. I see, that monitoring works fine under my account - when I'm disable access to port 8080 I'm receive 3 e-mails about "Bad" status and 1 e-mail about "Good" status
6. Close GUI - after that service run in background
7. Disable access to port 8080
8. I'm receive 1 e-mail about "Bad" status
9. Enable access to port 8080
10. BUG - still receive e-mails about "Bad" status, no e-mail about "Good" status at all
11. No matter, how many e-mails I'm receive about "Bad" status - the program never detects status change when running as service.

P.S. TCP Connection status check works perfectly, when the program run as service!
PwUser
Posts: 12
Joined: Sat May 15, 2010 10:22 am

Post by PwUser »

Apparently I've found the reason, why HTTPS test with client certificate does not work, wheh hostmon running as service. I'm connect to service via rcc as built-in user "Admin" and try to change test settings. When I try see certificates list I'm receive error: Host montor response: Test Error: Access is denied.
I'm try find out, where is Access denied via Process monitor, but no success. I'm suppose, that trouble in your code - it pass authenification wrong way and service does not have access to the certificate at all - no matter, where it published.
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Btw, but i'm found another bug.
Why do you think there is a bug if you even don't know test status? Have you checked what is going on using RCC? if you do not want to use RCC for some reasons, have you checked HostMonitor logs or report files?

Why do you use BAT file to stop service while you can use RCC and check test statuses, modify HostMonitor settings and so on?
RCC will show you what HostMonitor is doing while running as service.
http://www.ks-soft.net/hostmon.eng/rcc/index.htm

BTW Have you provided account with necessary rights using options located on Service page in HostMonitor Options dialog?

Regards
Alex
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

When I try see certificates list I'm receive error: Host montor response: Test Error: Access is denied
Have you provided correct account using options located on Service page in HostMonitor Options dialog?
I'm suppose, that trouble in your code - it pass authenification wrong way and service does not have access to the certificate at all - no matter, where it published.
You already reported several bugs for no reason. Looks like you just want to see some bugs in our code :roll:

1) Have you provided correct account using options located on Service page in HostMonitor Options dialog?
2) Where is your certificate installed? Is it installed in some user store or it is installed in "computer account" store? In 2nd case you should use UseLocalCertStore option: add UseLocalCertStore=1 line into [Misc] section of hostmon.ini file and restart HostMonitor.

Regards
Alex
PwUser
Posts: 12
Joined: Sat May 15, 2010 10:22 am

Post by PwUser »

:D As I wroute you previously all settings for test and service are correct.
I'm installed user certificate both in user and computer store, add UseLocalCertStore=1 line into [Misc] section of hostmon.ini, also add FilterClientCertificates=0, because this certificate really not marked as user. I'm run Hostmon as service under Local System account and point account with domain admin rights using options located on Service page in HostMonitor Options dialog. I'm connect to the service using RCC and see, that your code cannot see user cerficate at all. But when I run hostmon not as service, you prog see certificate, located in local computer store and test works perfectly.
http://213.247.232.100/bug.jpg - this is screenshot. In "Use client certificate" listbox initially I see the name of certificate. But when I click on arrow I'm receive error message.

P.S. CPU usage monitoring for remote hosts works perfectly, when hostmon run as service, i.e. account, that I'm pointed in Service page in HostMonitor Options dialog is correct.
PwUser
Posts: 12
Joined: Sat May 15, 2010 10:22 am

Post by PwUser »

The bug is real - I'm try to create new Test, that use client certificate, under service via RCC - I'm immediately receive Access denied message, only when I try to expand listbox with user certificates. Under win2003 the service can see client certificates.
Post Reply