LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Monitoring services. (https://www.linuxquestions.org/questions/linux-newbie-8/monitoring-services-4175465435/)

adumith 06-10-2013 11:05 AM

Monitoring services.
 
As administrator of the platform, one of my daily tasks is to see how much the system is running as servers.

To verify servers use fields as TOP, DF or PS.

I would like to do this a little easier, I mean, throught an SCRIPT I generate a report to display with the info that I need.

Does anyone have something similar that can share?

Thank you so much.

acid_kewpie 06-10-2013 12:21 PM

sounds like you want a bog standard server monitoring solution. go take your pick. Nagios is popular, as is groundworks, zenoss, hyperic, OpManager and dozens of others.

Habitual 06-10-2013 12:25 PM

As many answers as there are admins. ;)

Code:

ssh -i /path/to/key root@host (top, df, ps)
is the fastest way, or
Code:

snmpwalk -v 2c -c password IP OID
on targets can be scripted.
snmp being installed most everywhere these days, it requires little configuration.

Reports based on output, I'll leave to you or another reply.

Here's some references on snmp:
http://www.net-snmp.org/tutorial/tut...mon/snmpd.html
http://www.net-snmp.org/docs/FAQ.htm..._in_snmp_conf_
http://www.nwsmith.net/HintsTips/net-snmp-tutorial.htm
http://www.net-snmp.org/docs/man/snmpd.conf.html

Good luck!

adumith 06-10-2013 03:32 PM

Thanks a lot for everyone for your reply.

So, I didnīt explain myself as well as I should have.

In my server I can not install additional applications, due to contractual clauses.

I only I have access to them through ssh, so it is that I need a SCRIPT that allows me to collect this information and display it on the screen to take the data and record in my logbook.

Another idea?

Thanks again.

Habitual 06-10-2013 04:01 PM

Code:

ssh user@host cmd > outputfile.ext
where cmd is one of top, df, or ps and outputfile.ext is a redirect to your local machine.

adumith 06-10-2013 05:08 PM

Hello Habitual;

Thanks a lot for your reply; so thats exactly that I donīt wish to do.

I have this command:
ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'

Where, I remove all the process that used 0,0 at CPU; but I want to include at this command that only show me the command HTTPD.

And this another command:
ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS

Could you help me; please.

Thank in advance.

chrism01 06-10-2013 06:05 PM

You can certainly write your own scripts as above, but note that for many monitoring services eg Nagios, they primarily use the snmp protocol, which means you don't have to install anything on the target, just need a machine to run the cmds eg a spare server or even your wkstn, potentially.
As for ps & httpd, that'd be like
Code:

ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu |grep httpd | sed '/^ 0.0 /d'
You'll have to explain the 2nd cmd; give context.
Also, please use code tags to post cmds & output https://www.linuxquestions.org/quest...do=bbcode#code

Habitual 06-10-2013 08:02 PM

Quote:

Originally Posted by adumith (Post 4969171)
Hello Habitual;

Thanks a lot for your reply; so thats exactly that I donīt wish to do.

Well, I never! ;)

Whatever Chris says...

That's my "Final Answer"


All times are GMT -5. The time now is 12:34 AM.