NishantM
NishantM

Reputation: 161

Monitoring Linux server processes

This is for some suggestion and choice of right approach to monitor.

There is a RHEL6 server running several processes running under several SILOs and sandboxes, we need to monitor these process making sure these processes are up and running.

Currently I have made a script to which loops through all the sandboxes and check for the process status, then I send out a mail to the respective team with the list of jobs not running, as attachment.

Problem: Now since the number of sandboxes and jobs are quite many, it takes time to check and process and send out the mail, it sometimes leads to the outage for the other team. Also sub shell processes of the crashes when the server resources are low.

I am looking for an approach to make this monitoring quick and simple.

My Thoughts

The below command is quite handy and gives me the list of running processes.

    ps -ef|grep pset| awk '{print $9}'

Result,e.g.:

  /ab_sandbox_pi/propia/pset/process_a.pset
  /ab_sandbox_pi/apsia/pset/process_b.pset
  /ab_sandbox_pi/propia/pset/process_c.pset
  /ab_sandbox_pi/apsia/pset/process_d.pset

I want to use this command through a script and then process the resultant text.

  1. The script would write to a specific sheet of a excel, say sheet_pset, this excel would have a predefined macro/vb code to act as a string processor , would fetch data from sheet_pset and show result(based on condition applied), may be by click of a button or drop down.

  2. Creating a cient side java program, which would connect to RHEL6 server and get result of the ps command. Then at the client side would process and show the result. But this would require some authentication setup at RHEL6 which I am not sure would be fecilitated.

Please suggest which is the appropriate aprroach, or any other suitable approach I can take.

Upvotes: 1

Views: 1174

Answers (1)

J. Chomel
J. Chomel

Reputation: 8393

Solution is to do the data processing elsewhere - not on the server you try to monitor.

You should extract the whole ps -ef and send it to another server. Once you have retrieved the ps data to another computer, you do the filtering / table generating work.

  • Either you do through ssh from another server (this would be the easiest, but not possible given your architecture, agreed),

    ssh  -o BatchMode=yes  usernam@servername " ps -ef "
    
  • or you go on doing it by mail, but you only mail the complete extract to you --> you can send the whole thing by mail to yourself, and then have something processing the whole data on your computer, then send emails to everyone.

Upvotes: 1

Related Questions