LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-07-2010, 05:50 AM   #1
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Rep: Reputation: 31
remote system conky monitoring


my friend presents me with a problem. he uses sshfs on a raid system and wants conky to display processor usage, ram usage, and hard drive(raid) usage.

i looked on google, they suggested using x11 forwarding. good idea, but theres alot of overhead with x11 forwarding, and the fact of having to install X on a HEADLESS server!

my response to him involved using sshfs to mount the remote systems proc directory to his local system. this however does not work, yet regular ssh into the machine does.

furthermore i would need to plan out commands to refresh its memory usage, processor usage, and disk usage as my conky script is looking like its using local system commands only.

can someone throw a life ring as i run remote systems also, and that its a GREAT IDEA TO MONITOR THEM ON THE ONE IM ON!!!!
 
Old 04-07-2010, 06:20 AM   #2
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Original Poster
Rep: Reputation: 31
brain storming some voodoo up....

Code:
df | awk '{ print $5 }' | head -n 2 | tail -n 1 > /home/user/diskusage
ran as a cron job = a file created and updated reporting disk usage that sshfs can print... i know i dont need it updated every 2 seconds. minute by minute cron job of that would work fine for my situation. telling me the % of the disk being used. the head and tail would need adjusting on a system by system basis based on what the DF line you wanted printed.

now i gotta figure out a command to say what the processor usage is
 
Old 04-07-2010, 07:23 AM   #3
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Original Poster
Rep: Reputation: 31
i can easily write the memory free and memory total command to print those infos to a file, but im completely baffled on how to get the command line to print exactly how much cpu is in use at that exact moment of time.

im not looking for TOP... i would like to know how to do all combined processors, and have it print in a "60%" in use type way. i tried some commands under no load and under full load.

uptime gives me anywhere from 0.01 to 4.00? from nothing to full blast, im not a computer i want a %
 
Old 04-07-2010, 07:29 AM   #4
ddaemonunics
Member
 
Registered: May 2008
Location: Romania
Distribution: Debian
Posts: 242

Rep: Reputation: 41
iostat, sar from sysstat ...all can be integrated in cron jobs to output results in files etc etc

don't really see a problem here
don't really know conky's dependencies ...but you don't have to install x11 on the headless server ..only on the client machine from which you ssh into the server.
on the server you only install conky

From client:
ssh -X user@server conky
I run vmware workstation with ssh x forwarding over wan links....and it runs great

Last edited by ddaemonunics; 04-07-2010 at 07:38 AM.
 
0 members found this post helpful.
Old 04-24-2010, 02:22 PM   #5
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Original Poster
Rep: Reputation: 31
i dont want conky, x, or x forwarding on the server....

my gnome system monitor on the client says 65% of processor in use, iostat of the client gives a bunch of random values compared to that.

my problem is this part of your post

Code:
ssh -X user@server conky
i would rather run sshfs to mount a directory of cron jobs dumping cpu, mem, and disk usage to a directory with 3 files. 1 for proc usage, 1 for memory usage, 1 for disk drive usage.

-X Enables X11 forwarding. This can also be specified on a per-host
basis in a configuration file.

server is headless, does not have x, does not want x... do not want to install 100s of x packages chewing up ram, hard drive space, boot time, bandwidth (forwarding video when it can be forwarding plain text), or processor cycles.
 
Old 04-24-2010, 04:43 PM   #6
ninja master
Member
 
Registered: May 2008
Distribution: funtoo/gentoo amd64 xwrt
Posts: 412

Original Poster
Rep: Reputation: 31
Code:
#!/bin/bash
# by Paul Colby (http://colby.id.au), no rights reserved ;)
# modified by a drunken penguin to take a simple snapshot of cpu usage

PREV_TOTAL=0
PREV_IDLE=0

  CPU=(`cat /proc/stat | grep '^cpu '`) # Get the total CPU statistics.
  unset CPU[0]                          # Discard the "cpu" prefix.
  IDLE=${CPU[4]}                        # Get the idle CPU time.

  # Calculate the total CPU time.
  TOTAL=0
  for VALUE in "${CPU[@]}"; do
    let "TOTAL=$TOTAL+$VALUE"
  done

  # Calculate the CPU usage since we last checked.
  let "DIFF_IDLE=$IDLE-$PREV_IDLE"
  let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
  let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"
  echo "CPU: $DIFF_USAGE%"
exit
i rephrased the problem, and found a bash script....

it was giving constant updates and printing oddly so i modified it to suit my purpose

Last edited by ninja master; 05-07-2010 at 03:42 PM.
 
Old 07-23-2021, 05:23 AM   #7
pieroxy
LQ Newbie
 
Registered: Jul 2021
Posts: 3

Rep: Reputation: Disabled
Hello ninja master. I had the same problem you are describing, and so I wrote a program for this very purpose: Conkw. It stands for web based conky.

This is a program that, like conky, can monitor many vitals on your system but also all sorts of stuff (stocks, weather, etc) and exposes a REST API with all the data. It can also monitor a Windows or a MacOS machine.

There is also a HTML UI to display your stuff on any browser. The goal was to find some use to the old ipads/tablets we all have lying around. You can put them next to your screen and have your metrics displayed there. More real estate for the real work on your main screens!

But the network-based communication btw UI and API make it trivial to monitor another computer. In fact, you can build a mesh network and have metrics of plenty of different machines on the same UI.

It's still very much under development but I've been using it constantly for about 6 month now, so it works well.

Cheers !
 
Old 07-23-2021, 05:42 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Well. 11 years later.

Conky also has a configuration setting 'out_to_http', which makes it "act as a small http-server serving its text".
So you can run your conky remotely, producing properly formatted html output, and look at it with, say, a web browser.

Conky also has other options to accomplish the same.

BTW, gkrellm has this functionality built in, i.e. you can run a local gkrellm instance that displays remote gkrellmd data.
 
Old 07-23-2021, 07:05 AM   #9
pieroxy
LQ Newbie
 
Registered: Jul 2021
Posts: 3

Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
Conky also has a configuration setting 'out_to_http', which makes it "act as a small http-server serving its text".

BTW, gkrellm has this functionality built in, i.e. you can run a local gkrellm instance that displays remote gkrellmd data.
Thanks! I didn't know conkw had this option... gkrellm is pretty good for this very purpose indeed.

Last edited by pieroxy; 07-23-2021 at 07:30 AM.
 
Old 07-24-2021, 03:09 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by pieroxy View Post
Thanks! I didn't know conkw had this option...
No, conky has this option. conkw is something else.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
conky question: passing conky-variable to shell-script zlin50 Linux - Software 2 12-29-2012 06:47 PM
LXer: Conky - Lightweight system monitor in openSUSE LXer Syndicated Linux News 0 05-12-2009 02:30 AM
Conky System Monitor for Fedora 7 sou.1234321 Linux - Software 2 10-04-2007 05:58 AM
Conky on Suse 10.0 - *** buffer overflow detected *** conky terminated Slidex Linux - Software 1 03-17-2006 11:50 AM
try conky 1.3.0 -- lightweight, configurable system monitor jtan325 Linux - News 12 09-01-2005 11:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration