ODBC Connection to MS-SQL Server when starting as service
Hi,
I've problems using the odbc log when using hostmon as a service. Starting Hostmon as a "normal" program, everything is fine and it writes logs to my MS SQL 2000 Server. Hostmon runnig as service has problems to find the odbc connection. A problem could be that Hostmon only finds User-DSN and no System-DSN as ODBC connection. Any idea what to do ?
I've problems using the odbc log when using hostmon as a service. Starting Hostmon as a "normal" program, everything is fine and it writes logs to my MS SQL 2000 Server. Hostmon runnig as service has problems to find the odbc connection. A problem could be that Hostmon only finds User-DSN and no System-DSN as ODBC connection. Any idea what to do ?
Hostmonitor uses only the user-dsn. This means you can't use the system account when running HM as a service AND want to log to a database (the system account only sees system-dsn).
Solution:
Run HM with a user account (non system account), login as that user and create the odbc connection as a user-dsn.
When running as a service (under the above user account) HM will find the connection.
Solution:
Run HM with a user account (non system account), login as that user and create the odbc connection as a user-dsn.
When running as a service (under the above user account) HM will find the connection.
That wasn't the solution,
I started the service with another account, - the account I used for installing the User DSN. But it had no effect, I don't see the ODBC connection in HM. I just used the HM option for changing the logon of the service. Changing the service setting directly has also no effect.
Are there any other possibilities ?
I started the service with another account, - the account I used for installing the User DSN. But it had no effect, I don't see the ODBC connection in HM. I just used the HM option for changing the logon of the service. Changing the service setting directly has also no effect.
Are there any other possibilities ?
I can only say what I have done:
Create a user account
Log in using the above account and create the USER-DSN.
Start HM with the above user account as a service.
Stop HM service, start HS as an application (still as the above user).
Set the startup options in HM with the same account. Change the advanced logging options.
Save the settings and stop the application and start the service (still running under the above user account).
Don't forget if you start HM as application with a different account, you wil not see the USER-DSN (which was created for a different user).
If this still doesn't work, I'm out of suggestions.
Create a user account
Log in using the above account and create the USER-DSN.
Start HM with the above user account as a service.
Stop HM service, start HS as an application (still as the above user).
Set the startup options in HM with the same account. Change the advanced logging options.
Save the settings and stop the application and start the service (still running under the above user account).
Don't forget if you start HM as application with a different account, you wil not see the USER-DSN (which was created for a different user).
If this still doesn't work, I'm out of suggestions.
I think you don't see icon because you changed user account using standard Service application from Control Panel instead of setup user account in the HostMonitor's Options dialog. In order to fix this stop HostMonitor service, change account back to "local system" account, enable "allow service to interact with desktop" option, start HostMonitor as application, and setup user account on Service page in the Options dialog. Close application, start service.
http://www.ks-soft.net/hostmon.eng/mfra ... tm#Service
http://www.ks-soft.net/hostmon.eng/mfra ... tm#Service
Regards
Alex
http://www.ks-soft.net/hostmon.eng/mfra ... tm#Service
http://www.ks-soft.net/hostmon.eng/mfra ... tm#Service
Regards
Alex
But will you be able to use the USER-DSN?? This is not available for the system account, only SYSTEM-DSN is. This was the problem he started with.In order to fix this stop HostMonitor service, change account back to "local system" account, enable "allow service to interact with desktop" option, start HostMonitor as application, and setup user account on Service page in the Options dialog. Close application, start service.
H'm, interesting...
I checked code and made some experiments, it looks like impersonating the security context of the user does not have any effect for some ODBC functions (probably because these functions work with registry). I cannot find any mentioning about this problem in MSDN documentation
Will try to find some workaround.
Regards
Alex
I checked code and made some experiments, it looks like impersonating the security context of the user does not have any effect for some ODBC functions (probably because these functions work with registry). I cannot find any mentioning about this problem in MSDN documentation

Regards
Alex
Ok, there is solution at http://www.ks-soft.net/download/hm358.zip
Now HostMonitor uses system-DSN when started in service mode.
Regards
Alex
Now HostMonitor uses system-DSN when started in service mode.
Regards
Alex
I downloaded the update, created a system-dsn (the same as my user-dsn) and it worked. Assuming HM actually uses the system-dsn when started as a service (which I did not check).
But when starting HM as an application (for configuration) I still *only* see the user-dsn.
This is very confusing. The problem lies in the fact that I don't have control over the console and use Terminal Services to configure HM. Therefor I have to stop the HM running as a service and start it as an application.
If the two types of execution use different types of configuration, it's bound to happen that failures arise.
So my suggestion is to use the same dsn configuration (user or system) for both types of execution (service or application).
If it has any influence, I prefer the system-dsn.......
But when starting HM as an application (for configuration) I still *only* see the user-dsn.
This is very confusing. The problem lies in the fact that I don't have control over the console and use Terminal Services to configure HM. Therefor I have to stop the HM running as a service and start it as an application.
If the two types of execution use different types of configuration, it's bound to happen that failures arise.
So my suggestion is to use the same dsn configuration (user or system) for both types of execution (service or application).
If it has any influence, I prefer the system-dsn.......
Ok, there is update at http://www.ks-soft.net/download/hm361.zip
(just update to HM 3.60 (release) before using update).
Update has new option that allows you to choose DSN (option located on Miscellaneous page in the Options dialog). This option has effect when HM running as regular application, in service mode can be used system DSN only.
Regards
Alex
(just update to HM 3.60 (release) before using update).
Update has new option that allows you to choose DSN (option located on Miscellaneous page in the Options dialog). This option has effect when HM running as regular application, in service mode can be used system DSN only.
Regards
Alex