From inakimmalerba at gmail.com Fri Sep 25 15:46:56 2015 From: inakimmalerba at gmail.com (=?UTF-8?Q?I=C3=B1aki_Malerba?=) Date: Fri, 25 Sep 2015 12:46:56 -0300 Subject: [xmonad] Server status script Message-ID: Good morning. First of all, this is my first message and English is not my native language so patience, please. Im trying to write a script for my xmobar to show my server status. Its mainly a physical server and 2 virtual machines. I tried by sending ping and checking the response, but the xmobar freezes everytime its executed until it finishes the run. How can I fix it? Thanks in advance ! *checkserver.sh* #! /bin/bash > paping -p 81 -c 1 host.no-ip.org > /dev/null 2>&1 > if [ $? -ne 0 ] > then > VM0=0 > else > VM0=1 > fi > paping -p 82 -c 1 host.no-ip.org > /dev/null 2>&1 > if [ $? -ne 0 ] > then > VM1=0 > else > VM1=1 > fi > echo "here should say something acording to the result" *.xmobarrc* > ... > Run CommandReader "./home/inakim/.xmonad/checkServer.sh" "checkserver" > ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Fri Sep 25 15:51:28 2015 From: allbery.b at gmail.com (Brandon Allbery) Date: Fri, 25 Sep 2015 11:51:28 -0400 Subject: [xmonad] Server status script In-Reply-To: References: Message-ID: On Fri, Sep 25, 2015 at 11:46 AM, I?aki Malerba wrote: > Im trying to write a script for my xmobar to show my server status. Its > mainly a physical server and 2 virtual machines. > > I tried by sending ping and checking the response, but the xmobar freezes > everytime its executed until it finishes the run. > xmobar expects commands that it runs to return quickly. You will need to have a separate script that does the check and logs its result to a file, then check the contents of the file from xmobar. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathstuf at gmail.com Sat Sep 26 05:45:56 2015 From: mathstuf at gmail.com (Ben Boeckel) Date: Sat, 26 Sep 2015 05:45:56 +0000 (UTC) Subject: [xmonad] Server status script References: Message-ID: On Fri, 25 Sep, 2015 at 15:51:28 GMT, Brandon Allbery wrote: > xmobar expects commands that it runs to return quickly. You will need to > have a separate script that does the check and logs its result to a file, > then check the contents of the file from xmobar. You may also write the string to an X property on the root window and read it using NamedXPropertyLog. --Ben