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

need a special config.

Post by binaer »

Hello community

I need a special community. We're running an SMTP-Cluster. Time by time, one of the backend-server's overloaded (which is desired and okay and can happen - so, everything is fine). BUT: we would like to isolate this one sub-server from the cluster (scripts are ready to use).

Now, I need the following configuration:
1. Test: shows "Server overload".
2. Test: should fire ONE command (either SSH-Logon and fire a command with parms, or should fire a bat-file - but I NEED TO HAVE the output of this script checked by HM).

1. Question:
How should I configure my test (which one should I use?) that it is only triggered by another host and NOT repeat checking (the 2. Test should only run when the 1. Test changes status).
2. Question:
How can I check the Return-Codes (scriptres:OK or scriptres:Bad) and alert within the 2. Test?

I know, I could just add the "action" in the first test, but I really need the scriptres-Result being checked by HostMonitor (hence the fact that we have more than one server in the cluster and therefore, more than one can be isolated - but only all-1. So, if the last server is also overloaded, we would have a serious problem and therefore cannot just isolate this last one as well). Our Bash-Script is testing everything and just reports the status "scriptres:OK or scriptres:Bad" back...

I hope, I was clear enough... yes, it is a special test case but it is exactly, what we need 8)

kind regards
Pascal
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

which one should I use?
It depend on how do you determine that Server is overloaded.
It can be CPU Usage test or Dominant process or SMTP,etc.
1. Question:
How should I configure my test (which one should I use?)
that it is only triggered by another host and NOT repeat checking (the 2. Test should only run when the 1. Test changes status).
"2. Test" should be disabled.
"1. Test" may start Bad action "Run HMS script" with two commands:
EnableTest "2. Test"
RefreshTest "2. Test"

"2. Test" should start "Run HMS script" action (for Bad and Good status) with the following HMS script:
DisableTestByID %TestID%
2. Question:
How can I check the Return-Codes (scriptres:OK or scriptres:Bad) and alert within the 2. Test?
You may use ShellScript test with the following settings:
Start CMD: cmd /c %Script% %Params%
Script (Example):

Code: Select all

@echo off
echo scriptRes:Ok:My Script Reply
Script should echo using the following format: ScriptRes:<TEST_STATUS>:<TEST_REPLY>
E.G.
ScriptRes:Unknown:My Reply
ScriptRes:Ok:My Reply
ScriptRes:Bad:My Reply
binaer
Posts: 39
Joined: Tue Feb 28, 2006 2:01 am

Post by binaer »

"2. Test" should be disabled.
"1. Test" may start Bad action "Run HMS script" with two commands:
EnableTest "2. Test"
RefreshTest "2. Test"
great, did that, thank you. Now an additional Question: can I parse something like the trigger test-name to the hms-script so that I don't have to make one script for each backend-host?
"2. Test" should start "Run HMS script" action (for Bad and Good status) with the following HMS script:
DisableTestByID %TestID%
did that, thank you.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

great, did that, thank you. Now an additional Question: can I parse
something like the trigger test-name to the hms-script so that I don't have to make one script for each backend-host?
You may add test name("2. Test") to Comment line (e.g. Comment line 3) field of "1. Test" and modify HMS script:
EnableTest %CommentLine3%
RefreshTest %CommentLine3%
binaer
Posts: 39
Joined: Tue Feb 28, 2006 2:01 am

Post by binaer »

thank you - I'm trying to implement this right now and will give you feedback soon.
binaer
Posts: 39
Joined: Tue Feb 28, 2006 2:01 am

Post by binaer »

hmm, now, when I try to execute the bat-file, I'm getting as a reply to HostMonitor:
Unable to read from standard input: The handle is invalid.
But the script seems to run fine - and if I execute it from the command line, it works without any Problem (gives me back:)


any idea?
scriptres:OK:Server not disabled (smtpsrvX)
(this "Server not disabled" is okay in that case...)

just found this:
http://www.ks-soft.net/cgi-bin/phpBB/vi ... le+invalid

I have a Shell Script defined
Start cmd: %Script% %Params%
Script: "C:\Program Files (x86)\HostMonitor\Scripts\smtpsrv\isolate.bat" %1 %2
Params: stop smtpsrvX

Gives me the above error.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Could you try to add/modify "SScript_UseWindowsPipe=0" line in [Misc] section of hostmon.ini file and restart HostMonitor?
binaer
Posts: 39
Joined: Tue Feb 28, 2006 2:01 am

Post by binaer »

KS-Soft Europe wrote:Could you try to add/modify "SScript_UseWindowsPipe=0" line in [Misc] section of hostmon.ini file and restart HostMonitor?
Yes, didn't help in that case. Any other hint would be appreciated :-?
Now, I can't start HostMonitor anymore using the Service-Section in Windows SRV (2008, 64 bit), Error 193, 0xc01 :(
I can start it manually... I might do that as I don't want to reboot the server right now...

It keeps dying, even with the 9.5-Version... except if I open it manually (not use the "service"-Function (also, not use the /service-Parm)

In the system log, I can find: "is not a valid W32-Process"...
this is absolutely weird... I could solve this issue. There was a file in the "C:/"-Root, called "Program". It prevented me to start the service. The file got placed there when I shut down HostMonitor (but it doesn't look like it's a HM-Issue!). I'm just writing it down here so that in case it happens to someone else, he's able to solve it. Even: my root problem is not solved, but it's not urgent.
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

There was a file in the "C:/"-Root, called "Program". It prevented me to start the service. The file got placed there when I shut down HostMonitor (but it doesn't look like it's a HM-Issue!).
Do you mean HostMonitor service does not start when there is "c:\program" file on the disk?
HostMonitor does not create such file (unless you setup c:\program as target for some log or report file or use some custom script).
I'm just writing it down here so that in case it happens to someone else, he's able to solve it. Even: my root problem is not solved, but it's not urgent.
Do you mean "Unable to read from standard input: The handle is invalid." error?

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

Post by binaer »

Do you mean HostMonitor service does not start when there is "c:\program" file on the disk?
HostMonitor does not create such file (unless you setup c:\program as target for some log or report file or use some custom script).
exactly. Yes, I didn't mean to blame this on HostMon-Software... it looks like a Windows-Problem. Just wanted to write it down how to solve for others.
Do you mean "Unable to read from standard input: The handle is invalid." error?
yes, right. I'm still facing the same issue. Workaround doesn't seem to work, not even switching to "SSH Test"-Method (see http://www.ks-soft.net/cgi-bin/phpBB/vi ... php?t=5311). Any other idea?
my hostmon.ini [Misc] section:

Code: Select all

[Misc]
[...]
SScript_UseWindowsPipe=0
I'm running the 9.50 version now (didn't help - from 8.80).
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I have a Shell Script defined
Start cmd: %Script% %Params%
Script: "C:\Program Files (x86)\HostMonitor\Scripts\smtpsrv\isolate.bat" %1 %2
Params: stop smtpsrvX
This cannot be executed. BAT file is not executable file.
Should be
Start cmd: cmd /c "C:\Program Files (x86)\HostMonitor\Scripts\smtpsrv\isolate.bat" %Params%
Script: <empty>
Params: stop smtpsrvX [/quote]

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

Post by binaer »

KS-Soft wrote: This cannot be executed. BAT file is not executable file.
Should be
Start cmd: cmd /c "C:\Program Files (x86)\HostMonitor\Scripts\smtpsrv\isolate.bat" %Params%
Script: <empty>
Params: stop smtpsrvX
thank you - but doesn't make any difference :(
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

HostMonitor started as service? Application? Acount used to run HostMonitor?
UAC enabled?
Service Pack?
Antivirus monitor?

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

Post by binaer »

KS-Soft wrote:HostMonitor started as service? Application? Acount used to run HostMonitor?
UAC enabled?
Service Pack?
Antivirus monitor?
Hey.

Started as service? Yes
Account used? System Account
UAC enabled. Disabling it needs reboot, I think.
Windows Server 2008, R2 Standard, SP1, 64-bit
no AntiVirus on this Machine
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Account used? System Account
Local system account is specified on Windows Services applet (services.msc) and on Service page of HostMonitor Options dialog, right ?
Post Reply