Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2011
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    2

    Monitoring commands

    Does anyone have any monitoring commands they like to use? I currently use top -s to monitor what's currently happening and occasionally sar -q to see if the server had any high loads at certain points.




  2. #2
    Join Date
    Oct 2011
    Posts
    46
    Thanks
    0
    Thanked 7 Times in 6 Posts
    Rep Power
    10
    Great question. In my experience, you have 4 main things that you have to stay on top of.

    1) CPU
    2) Memory
    3) Disk
    4) Network

    `top -c` will give you a good indication of CPU & Memory, but it won't tell you much about Disk or Network. For a quick snapshot of disk i/o, I prefer using `iotop`, and to get a quick look at network I usually look at `netstat -tuna`. Also, we like to run `vnstat` on our servers so that it tracks the historical usage of network as well as the current usage. We have some fancy nagios scripts that pull and parse vnstat data out and alert us if things start getting crazy.

    Great question. Glad you asked.

  3. #3
    Join Date
    Nov 2011
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    2
    root@clients [~]# vnstat
    bash: vnstat: command not found

    =================================

    root@clients [~]# iotop
    bash: iotop: command not found

    =================================

    By the looks of it, I won't be testing out either of them any time soon.

  4. #4
    Join Date
    Nov 2011
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by MustangV10 View Post
    root@clients [~]# vnstat
    bash: vnstat: command not found

    =================================

    root@clients [~]# iotop
    bash: iotop: command not found

    =================================

    By the looks of it, I won't be testing out either of them any time soon.
    Which distro are you running? (Debian, RedHat, SuSE, Ubuntu, etc...)

  5. #5
    Join Date
    Nov 2011
    Posts
    71
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Rep Power
    2
    Check for applications like vmstat, iostat, mpstat. Also don't forget trusty ps aux --sort pcpu.

    RHEL editions usually have a tool called dstat as well.
    Last edited by grim76; 11-22-2011 at 09:59 PM. Reason: Forgot one

  6. #6
    Join Date
    Nov 2011
    Location
    Abu Dhabi, United Arab Emirates
    Posts
    10
    Thanks
    0
    Thanked 4 Times in 2 Posts
    Rep Power
    0
    Quote Originally Posted by MustangV10 View Post
    By the looks of it, I won't be testing out either of them any time soon.
    Don't give up so soon! It's easy to install them, e.g. if you're on fedora the package names are the same as the program names, so just find them in Add/Remove Software (or do yum install vnstat iostat).

    I love the simple things. In addition to the things mentioned, I like a good ps or lsof command. Instructive examples:
    Code:
    • ps axru
      # shows running processes with extra info
    • ps -FC httpd
      # shows httpd processes with extra info
    • ps -eo pcpu,rss,pid,comm --sort=-rss | head
      # shows most ram-heavy processes
    • lsof /var/log/messages
    • lsof +d /var/log
    • lsof +D /var/log
    • lsof -c bas
      #info on what cmd starting with 'bas' in its name has open
    • lsof -p 20628
      #info on what PID has open
    • lsof -u ryran -c fire
      #all ryran's procs + all fire.* procs as well
    • lsof -c httpd -a +D /var/www/html
      #all processes that have open files in /var/www/html and are named httpd.*
    • lsof -i
      #list internet files (open ports & established connections)
    • lsof -i tcp:ssh,80
    • lsof -i tcp -a -u ryran

  7. The Following User Says Thank You to ryran For This Useful Post:

    Rob (11-28-2011)

 

 

Similar Threads

  1. useful commands for apache logs
    By tomfmason in forum Command Line
    Replies: 2
    Last Post: 11-13-2011, 04:29 PM
  2. Linux Commands - README
    By Rob in forum Linux Commands
    Replies: 0
    Last Post: 11-03-2011, 09:47 AM
  3. How To Use Builtin Commands
    By Fred in forum Linux News
    Replies: 0
    Last Post: 11-01-2011, 07:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
           








Check out Linux Central for Linux software and other goodies!





» Stats

Members: 3,560
Threads: 3,917
Posts: 9,434
Top Poster: Fred (1,486)
Welcome to our newest member, ajit102

» Links



Powered by vBadvanced CMPS