need a special config.

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
binaer
Posts: 39
Joined: Tue Feb 28, 2006 2:01 am

Post by binaer »

KS-Soft Europe wrote:
Account used? System Account
Local system account is specified on Windows Services applet (services.msc) and on Service page of HostMonitor Options dialog, right ?
yes, I'm positive about that.

That's my script:

Code: Select all

@echo off
"C:\Program Files (x86)\HostMonitor\plink\plink.exe" -i "C:\path\keys.ppk" "user@host" "/home/path/isolate.sh %1 %2"
Last edited by binaer on Mon Jul 01, 2013 2:33 am, edited 1 time in total.
binaer
Posts: 39
Joined: Tue Feb 28, 2006 2:01 am

Post by binaer »

I solved my Problem right now. I replaced the newest "plink.exe" with one out of the 0.58-Version of the Putty-Installer. Now, the Problem is gone and the output is like:
[18:15:29] HostMonitor is going to execute "smtpsrv - de-/isolate system" script ...
[18:15:30] Script executed, correct result received:
----------
- Status: Ok
- Reply: x is now in maint-mode
----------
I was trying this the last night already - but I replaced it to the wrong directory :(
Last edited by binaer on Mon Jul 01, 2013 2:31 am, edited 1 time in total.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

I solved my Problem right now.
Great :)
I replaced the newest "plink.exe" with one out of the 0.58-Version of the Putty-Installer. Now, the Problem is gone
So problem was with latest version of plink.exe (beta 0.62)?
Thank you for the notice!
binaer
Posts: 39
Joined: Tue Feb 28, 2006 2:01 am

Post by binaer »

KS-Soft Europe wrote: So problem was with latest version of plink.exe (beta 0.62)?
yep, see http://www.chiark.greenend.org.uk/~sgta ... valid.html.

Now, I only get a "script timed out"... any hint on that?
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Now, I only get a "script timed out"... any hint on that?
This means script does not return any result within specified timeout.
You said it works, what did you change?

Regards
Alex
binaer
Posts: 39
Joined: Tue Feb 28, 2006 2:01 am

Post by binaer »

KS-Soft wrote:
Now, I only get a "script timed out"... any hint on that?
This means script does not return any result within specified timeout.
You said it works, what did you change?

Regards
Alex
Hey Alex

Yeah, well.... It worked in the "lets try"-screen, but never within the test itself... The parms should be okay, at least, there would be an error message from the script...
binaer
Posts: 39
Joined: Tue Feb 28, 2006 2:01 am

Post by binaer »

Hi Alex

one further info over here: got the problem solved a bit more now again.

The problem was, that the Message
he server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
from plink got returned and I couldn't see that, because of the hostmon.ini-settings. I reverted it (deleted the line "SScript_UseWindowsPipe=0" out of hostmon.ini) and now everything seems to work fine (got an output which made sense and enabled me to solve the "Timeout"-Issue). I could got a rid of the HostKey-Message by using
echo yes | plink.exe [params] username@host command
for the first time I called the script (or just after I realized that there's a problem with that. After I executed this command, I reverted the script to what it was before and it worked, except:
If I Disable the Test like this:

Code: Select all

SetTestParam "smtpsrv.mailsys - Isolation" commentline1 "start"
SetTestParam "smtpsrv.mailsys - Isolation" commentline2 "%commentline2%"
EnableTestByID 633
RefreshTestByID 633
DisableTestByID 633
it looks like, the "Refresh" will not be executed (at least, the script doesnt work and I don't get a reply). If I do the same without the "Disable"-Test statement, it works.

Maybe, is there a way to delay the "DisableTest" statement by a couple of seconds or do something similar?

So, at all, the only way which seems to work with plink is to use the Version 0.58 other than anything newer. Then, you don't have to set "SScript_UseWindowsPipe=0" (but you might could, I didn't try that any further now). It doesn't work with any newer plink-Version because of the bug in plink-application (which is known since 2007 and not fixed, yet). Enable, Refresh and Disable itself doesn't seem to work with an external script test, we need something to delay the "Disable"-HM Command. I could build a workaround, but maybe there's a more nice way to do it than a "hack"...
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

RefreshTestByID 633
DisableTestByID 633
Test will not be executed because you disable it right away.
Probably you don't need to disable test? Just set long test interval?

How do you start this HM Script? Using some other test method? And you always need to execute test and disable it?
Then you may remove DisableTestByID from this script and add DisableTestByID into HM Script assigned to test with ID 633. So test will be executed and then test item will disable itself.

Regards
Alex
binaer
Posts: 39
Joined: Tue Feb 28, 2006 2:01 am

Post by binaer »

KS-Soft wrote: Probably you don't need to disable test? Just set long test interval?
well, I actually do. The disabled test doesn't do anything else than execute a script with a whole bunch of Parameters (Commentline) and checks if it run successfully (that's why I even made it using a test..). After this command is processed, it should run again with the same params (even, it doesn't really matter... but).
KS-Soft wrote: How do you start this HM Script? Using some other test method? And you always need to execute test and disable it?
yes, some tests are health-checking some servers. If they see something "abnormal", they will trigger an HMScript which executes the "snipped" I showed you (where it performs afterwards the plink.exe-Script). Therefore, the return valued should be checked.
Then you may remove DisableTestByID from this script and add DisableTestByID into HM Script assigned to test with ID 633. So test will be executed and then test item will disable itself.
yes, what I could do in the triggering test action is add another HMScript which disables the test after some more "failures" and set the actual "perform-script"-test to a high value. That's what I call workaround :P
It would work here, I guess...
binaer
Posts: 39
Joined: Tue Feb 28, 2006 2:01 am

Thank you

Post by binaer »

So, what I could do now is to create a test for every SMTP-Slave Server and disable it from the originating check-test after another recurrence of a "bad" state. I can't do this with my current implementation (only one "triggering test for the isolation solution") hence the fact, that there could be more than one isolation within a little time and could possible cause a "deadlock" between the tests itself (so that at least the isolation would not work).

It would be awesome to have a little "delay"-function or a sequenzial processing of the HMScript-Commands in certain situations...

In general, it works now. As a reference for others, the outcomes are:
  • - Use only Putty 0.58 from the Putty-Installer (an old one). Newer Putty-Versions, including 0.62 beta, doesn't seem to work correctly (see http://www.chiark.greenend.org.uk/~sgta ... valid.html).
    - "SScript_UseWindowsPipe=0" should not be in [Misc]-Section in hostmon.ini hence the fact, that it prevents the output to be even shown (the script just times out). Maybe, it works, but I couldn't check this yet. You can't see any error messages (for sure).
    - putty: first time to connect to a host, you need to tell putty, that the hostkey is "okay" by putting

    Code: Select all

    echo yes | plink.exe [params] username@host "your command"
    delete the "echo yes | "-Section after you started the script once from HostMonitor.
    - You cannot:
    RefreshTestByID <id>
    DisableTestByID <id>
    where there is an external script running as it would not get started.
Used Version now: 9.50 (and before 8.80).
Windows Server 2008, SP1
HostMonitor started as a Service using "System Account" (that's important to know because of the "HostKey"-Issue from plink.

In general, I wanted to express my sincere thank to KS-Soft for the great response-time in the forum and using mail all the time. Again, I could see what a powerful tool HostMonitor is. There is a million way to solve problems with it and obviously, it's not possible to fulfill 100% of all the wishes (see the above "delay"-Wish :) ). My solution works now as designed and desired, even with little workaround - which I might be able to replace soon with a nice and fancy solution thanks to HostMonitor and the Team behind it.
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

It would be awesome to have a little "delay"-function or a sequenzial processing of the HMScript-Commands in certain situations...
Its not just delay... For various reasons HostMonitor stops monitoring when executes HM Script. For this little option everything should be redesigned and behaviour of some commands will be different. Also, you cannot be 100% sure what exactly delay is necessary. E.g. if there are some problems with logging and too many records in the pool, HostMonitor may delay test execution.
In general, I wanted to express my sincere thank to KS-Soft for the great response-time in the forum and using mail all the time. Again, I could see what a powerful tool HostMonitor is. There is a million way to solve problems with it and obviously, it's not possible to fulfill 100% of all the wishes (see the above "delay"-Wish ). My solution works now as designed and desired, even with little workaround - which I might be able to replace soon with a nice and fancy solution thanks to HostMonitor and the Team behind it.
Thank you

Regards
Alex
Post Reply