pyrater Posted February 15, 2014 Share Posted February 15, 2014 Warning noob stuff contained within. Looking to you guys for input on this, i know the script can be improved upon and was trying to see if i can get some feedback from you guys as to what to change / add etc... Added ability to monitor Plex, Sb, CP, unRAID, Mumble, Minecraft, uTorrent and sends a txt if down. edit .bash_profile to run the following script. Link to gist: https://gist.github.com/Pyrater/9022562 (latest code) #!/bin/bash while : do hdspacetot=$(df -h /mnt/user/ ~ | awk 'NR==2 {print $2}') hdspacefree=$(df -h /mnt/user/ ~ | awk 'NR==2 {print $4}') curl http://192.168.2.4 -s -m 4 -f -o /dev/null && ur='\e[42;30mUP\e[0m' || ur='\e[41;30mUP\e[0m' curl http://192.168.2.11:8080/gui -s -m 2 -f -o /dev/null && ut='\e[42;30mUP\e[0m' || ut='\e[41;30mDN\e[0m' curl http://192.168.2.11:8081 -s -f -m 2 -o /dev/null && sb='\e[42;30mUP\e[0m' || sb='\e[41;30mDN\e[0m' curl http://192.168.2.11:8082 -s -f -m 2 -o /dev/null && ch='\e[42;30mUP\e[0m' || ch='\e[41;30mDN\e[0m' curl http://192.168.2.12:32400/web -s -f -m 2 -o /dev/null && px='\e[42;30mUP\e[0m' || px='\e[41;30mDN\e[0m' curl http://192.168.2.12:32400/web -s -f -m 2 -o /dev/null && px='\e[42;30mUP\e[0m' || px='\e[41;30mDN\e[0m' exec 6<>/dev/tcp/192.168.2.12/64738 && mb='\e[42;30mUP\e[0m' || mb='\e[41;30mDN\e[0m' exec 6<>/dev/tcp/192.168.2.105/25565 && mc='\e[42;30mUP\e[0m' || mc='\e[41;30mDN\e[0m' clear echo -e "+==============================================================================+" echo -e "= =" echo -e "= \e[1;34m:\e[0m\e[1;37m:\e[0m\e[1;34m:\e[0m\e[1;31m=====\e[0m \e[1;37m:\e[0m\e[1;34m:\e[0m\e[1;37m:\e[0m\e[1;31m====\e[0m \e[1;34m:\e[0m\e[1;37m:\e[0m\e[1;34m:\e[0m\e[1;31m====\e[0m \e[1;37m:\e[0m\e[1;34m:\e[0m\e[1;37m:\e[0m\e[1;31m====\e[0m \e[1;34m:\e[0m\e[1;37m:\e[0m\e[1;34m:\e[0m\e[1;31m===\e[0m =" echo -e "= \e[1;37m:\e[0m\e[1;34m:\e[0m\e[1;37m:\e[0m \e[1;34m:\e[0m\e[1;37m:\e[1;34m:\e[0m \e[1;37m===\e[0m \e[1;37m:\e[0m\e[1;34m:\e[0m\e[1;37m:\e[0m \e[1;37m===\e[0m \e[1;34m:\e[0m\e[1;37m:\e[0m\e[1;34m:\e[0m \e[1;37m===\e[0m \e[1;37m:\e[0m\e[1;34m:\e[0m\e[1;37m:\e[0m =" echo -e "= \e[1;31m=== === === ======= ======= =====\e[0m =" echo -e "= \e[1;37m=== === === === === === ===\e[0m =" echo -e "= \e[1;31m=======\e[0m \e[1;32m=\e[0m \e[1;31m======\e[0m \e[1;32m=\e[0m \e[1;31m=== ===\e[0m \e[1;32m=\e[0m \e[1;31m===\e[0m \e[1;32m=\e[0m \e[1;31m======\e[0m =" echo -e "= =" echo -e "= Combined Operations in Rack Portable Storage =" echo -e "= =" echo -e "= VM Resource Pool Application Status =" echo -e "= *------------------------------* *-------------------* =" echo -e "= | unRaid vCPU 1 / 2698 MEM | | unRAID: $ur | =" echo -e "= | Arch vCPU 2 / 2045 MEM | | Plex: $px | =" echo -e "= | Windows7 vCPU 8 / 3072 MEM | | SickBeard: $sb | =" echo -e "= *------------------------------* | CouchPotato: $ch | =" echo -e "= | uTorrent: $ut | =" echo -e "= Raid Space | Mumble $mb | =" echo -e "= *------------------------------* | MC Server $mc | =" echo -e "= | $hdspacefree TB Free / $hdspacetot TB Total | *-------------------* =" echo -e "= *------------------------------* =" echo -e "= =" echo -e "= IP 192.168.2.4 / 255.255.255.0 / 192.168.2.1 =" echo -e "+==============================================================================+" sleep 60 done # add temp? CPU type info? unraid Version? Quote Link to comment
speeding_ant Posted February 15, 2014 Share Posted February 15, 2014 Cool! I like stuff like this, good for integrated LCD screens on cases Ditch the large header to fit more information in though, maybe offer an option to include an ASCI unRAID logo or something. Memory, CPU, total network / disk throughput, and top 5 CPU hogging processes would be ideal. Then more specific unRAID info to top it off. Keep it on a refresh loop of x seconds. Quote Link to comment
pyrater Posted February 15, 2014 Author Share Posted February 15, 2014 Do you know how to have this run and print to the console on boot and whenever i login via telnet? /etc/rc.local isnt there.... Well on login its .bash_profile just need at boot now... Quote Link to comment
nicinabox Posted February 15, 2014 Share Posted February 15, 2014 Very cool! Love seeing stuff like this. Quote Link to comment
pyrater Posted February 15, 2014 Author Share Posted February 15, 2014 Thank you, working on adding txt message support but the script isnt firing correct. curl http://192.168.2.11:8081 -s -f -m 2 -o /dev/null && sb='\e[42;30mUP\e[0m' || sb='\e[41;30mDN\e[0m' && curl "http://textbelt.com/text" -d number=XXXXXXXXXX -d "message=SickBeard is Down" The problem is that it fires off a text whether Sickbeard is up or down...... the issue is something here || sb='\e[41;30mDN\e[0m' &&. aka If the website is null than change the variable to DN and fire off a text... Quote Link to comment
nicinabox Posted February 15, 2014 Share Posted February 15, 2014 Just a thought-- you might consider putting this code in a gist so it can be versioned easily. Forums aren't exactly great for code sharing. Quote Link to comment
pyrater Posted February 15, 2014 Author Share Posted February 15, 2014 Link to gist: https://gist.github.com/Pyrater/9022562 Quote Link to comment
MyKroFt Posted February 22, 2014 Share Posted February 22, 2014 I would look into tmux - its a screen/window mgr - can have multi seperate windows on a screen and multi screens. You an direct a process to a "pane" i guess is what they call them and not have scrape from utils etc I use it here on my nzb indexer for all the different processes runing myk Quote Link to comment
pyrater Posted February 22, 2014 Author Share Posted February 22, 2014 neat gonna have to look into tmux, not sure how/if i will implement it. Quote Link to comment
WeeboTech Posted February 22, 2014 Share Posted February 22, 2014 put the script in /etc/profile.d if you want to run it at every boot for every login. You might be able to make an /etc/issue file so that it's the standard banner for telnet and/or tty display. I have not played with this in ages, but you can poke around here. http://www.linuxfromscratch.org/blfs/view/svn/postlfs/logon.html Quote Link to comment
pyrater Posted February 22, 2014 Author Share Posted February 22, 2014 I put a call in .bash_profile ie: ./boot/config/plugins/gui.sh which runs at every log in / prompt Quote Link to comment
MyKroFt Posted February 22, 2014 Share Posted February 22, 2014 if it is just gonna display text, sleep and rotate - you can start it via the go file and direct it to one of the extra ttys - i direct a tail -f of my syslog to F9 Myk Quote Link to comment
nicinabox Posted February 25, 2014 Share Posted February 25, 2014 if it is just gonna display text, sleep and rotate - you can start it via the go file and direct it to one of the extra ttys - i direct a tail -f of my syslog to F9 Myk I think modifying the go file is considered a bad practice. The "correct" way to do it is on the startup or disks mounted event. Quote Link to comment
MyKroFt Posted February 25, 2014 Share Posted February 25, 2014 many things are/can be started from the go file - unMenu is the main one that comes to mind Myk Quote Link to comment
bonienl Posted February 25, 2014 Share Posted February 25, 2014 many things are/can be started from the go file - unMenu is the main one that comes to mind Myk True, but any array related activities should be started/stopped based on the event system which exists now. Modifying the go file programmably is not very flexible, the better way is to use the plugin system. Quote Link to comment
MyKroFt Posted February 25, 2014 Share Posted February 25, 2014 We are not talking about a plugin. It's a status bash script Sent from my SCH-I545 using Tapatalk Quote Link to comment
KayakNate Posted June 25, 2021 Share Posted June 25, 2021 (edited) Sorry to revive an old thread. New to unraid and recently built a machine with a 5700g, not realizing that there isn't much useful info that will display on the monitor connected to the actual unraid machines attached monitor. Been searching for some kind of status plugin or something that will display useful info on the machines monitor. This old post is sort of what I'm looking for. But it hasn't been updated in a while. Is there something like this that is current, or can someone suggest search terms to help me find something that will display stats or statuses of some sort on the monitor connected to the actual unraid box? Edited June 25, 2021 by KayakNate 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.