Respected Monks,

We have been working to administrate(start/stop) and monitor the health status of processes running on either Linux/Solaris systems. We have built easy to use web based applications on a dedicated linux server for performing the start/stop/status operations for all remote systems processes and using SSH protocol for connectivity ( Net::SSH::Expect ).

Also the client is looking forward to administrate and monitor few processess running on Windows platform. So, we have tried few options in monitoring the Windows processess from a the linux server.

OPTION-1)

We have installed SNMP service on the windows system and written a sample perl script to obtain the status of the processes. Used the snmpwalk command and grepped out the service name and its statistics like Status, CPU Performance, Memory Utilised, PID and Path etc.

Here is the part of code of this script

my $IP=$ARGV[0]; my $COMMUNITY=$ARGV[1]; my $Service=$ARGV[2]; my $resultat =`snmpwalk -v 1 -c $COMMUNITY $IP | grep $Service`; ###Sn +mp Object host resource names my @sid; my $pb_calcul; my @memory; if($resultat){ $resultat =~ s/HOST-RESOURCES-MIB::hrSWRunName.(\d+)\s+=\s+\w+:\s+ +(.*)/$1:$2/g; @sid=split(/:/,$resultat); my @nextresult =`snmpwalk -v 1 -c $COMMUNITY $IP | grep $sid[0]`; foreach my $rec(@nextresult){ if($rec =~ m/HOST-RESOURCES-MIB::hrSWRun(\w+).\d+\s+=\s+\w+:\s ++(.*)/){ print "$1 ------> $2\n"; } }

Usage -> $PROGNAME <IP> <COMMUNITY> <service>

Output of the Script

[root@station17 sushil]# perl check_win_processall.pl station16 p +ublic services Index ------> 1208 Name ------> "services.exe" ID ------> SNMPv2-SMI::zeroDotZero Path ------> "C:\\WINDOWS\\system32\\" Type ------> application(4) Status ------> running(1) PerfCPU ------> 271 PerfMem ------> 4144 KBytes

But using this we are just able to monitor the status and don't have to ability to start and stop the process.

OPTION - 2) On Windows system we have installed OpenSSH software and made few basic configurations, created password and group files for authentication. And using this we can connect to windows system from the linux box using the ssh command

# ssh <Windows IP Address>
And we can successfully login to the Windows systems and we get the prompt. With this we have written a script using Net::SSH::Expect module to connect to the Windows systems and check for the status and also start/stop the processes. So, we have used the above two options, I wanted to now is there any other way to administrate and monitor the status of the Windows processes. Main reason is that with the above 2 Options we have few cons

Option 1 => Unable to start/stop a process

Option 2 => Need to install OpenSSH s/w on all the remote system boxes ( Say if there are 50 + systems then a major drawback )

Also when we have gone througth the old threads, we have found that WMI is also an other method to administrator windows processes. When we have searched in cpan for any module that supports this technology, and tried to install that module in a linux box, it prompted us with a message "OS unsupported".

So, please let me know if there is any other way to do the monitoring and start/stoping the processes.

Thanks In Advance
Sushil Kumar

In reply to Options on Windows Process Managment by msk_0984

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.