Highlighted
Established Member..
Established Member..
726 views

SiteScope script Monitor

Jump to solution

Hi All,

I am trying to develop a SiteScope monitor that counts total number of specific processes running on 3 servers.

I tried some solutions but I think the most reliable one is "Script monitor" so I developed the below script:

 #!/bin/bash
server1="$(ps -ef | grep -c -E "$1")"
server2="$(ssh bsm_adm@dekbap2ia "ps -ef | grep -c -E '$1'")"
server3="$(ssh bsm_adm@dekbap3ia "ps -ef | grep -c -E '$1'")"
Total=$(expr "$server1" + "$server2" + "$server3")
echo $Total

but it fails with time out error, here is the error from Debug level log:

(SSHV2Connector.java:1230) ERROR - com.mercury.sitescope.util.ssh.exception.SSHV2TimedOutException: Reading from server timed out. Time spent on reading = 45755 threshold = 45741
com.mercury.sitescope.util.ssh.exception.SSHV2TimedOutException: Reading from server timed out. Time spent on reading = 45755 threshold = 45741
at com.mercury.sitescope.util.ssh.SSHV2Connector.waitForReadToComplete(SSHV2Connector.java:449)
at com.mercury.sitescope.util.ssh.SSHV2Connector.read(SSHV2Connector.java:356)
at com.mercury.sitescope.util.ssh.SSHV2Connector.access$600(SSHV2Connector.java:38)
at com.mercury.sitescope.util.ssh.SSHV2Connector$SSHV2Executor.internalExec(SSHV2Connector.java:1087)
at com.mercury.sitescope.util.ssh.SSHExecutor.execute(SSHExecutor.java:157)
at com.mercury.sitescope.util.ssh.SSHRemote.execute(SSHRemote.java:340)
at com.mercury.sitescope.util.ssh.SSHManager.execute(SSHManager.java:122)
at com.mercury.sitescope.util.cmdline.SSHCommandLine.exec(SSHCommandLine.java:159)
at com.mercury.sitescope.util.cmdline.CommandLine.execWithEnglishLocale(CommandLine.java:277)
at com.mercury.sitescope.util.cmdline.CommandLine.exec(CommandLine.java:218)
at com.mercury.sitescope.monitors.facades.ScriptMonitor.update(ScriptMonitor.java:1082)
at com.mercury.sitescope.entities.monitors.AtomicMonitor.monitorUpdate(AtomicMonitor.java:2068)
at com.mercury.sitescope.entities.monitors.AtomicMonitor.run(AtomicMonitor.java:2347)
at com.mercury.sitescope.infra.threads.ThreadPool$SingleThread.runTask(ThreadPool.java:462)
at com.mercury.sitescope.infra.threads.ThreadPool$SingleThread.run(ThreadPool.java:488)

 

I tried to update timeout param in Infrastructure Preferences with no success.

Anyone have any idea , modification on the script, different monitor type and support will be highly appreciated.

MTS

Labels (2)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Hey,

while I can't tell you why the script monitor enters a timeout here, there might be other options depending on your circumstances.
A) Can you access all 3 machines via SSH directly from SiteScope?
B) Do you only care for the total number of processes? Or do you start caring if say, all 3 should be running 3 instances each but two run 4 and one runs 1(would also be 9)?

You can query running processes with the "Unix Ressources Monitor" - via "Objects - Process".
I usually query status "running" for situations like these.

regards

View solution in original post

0 Likes
3 Replies
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Hey,

while I can't tell you why the script monitor enters a timeout here, there might be other options depending on your circumstances.
A) Can you access all 3 machines via SSH directly from SiteScope?
B) Do you only care for the total number of processes? Or do you start caring if say, all 3 should be running 3 instances each but two run 4 and one runs 1(would also be 9)?

You can query running processes with the "Unix Ressources Monitor" - via "Objects - Process".
I usually query status "running" for situations like these.

regards

View solution in original post

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Hello,

 

Do you have the output running this script from outside the SiteScope?

Also please let us know if the suggestion about using the Unix Resources monitor does work for you? 

Regards,  

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Hello MinaTalaat 

I would like to know if you still need help after the recomendations

Thanks

Jose Garita

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.