You are not logged in.
As an argument to curl:
curl -L ...
Offline
Offline
I feel like I jumped off the high diving board only to see an empty pool.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
I feel like I jumped off the high diving board only to see an empty pool.
No, i've dont make the UP/Down script
Offline
This might work, when you see "--" the server might be down (Thanks to xaos52 for the timeout idea)
${execi 60 curl -m 10 http://someurl/disk.php 2> /dev/null || echo --}
One can test this with a command like
curl -m 0.1 'https://api.ipify.org' 2> /dev/null || echo --
(Reduce -m time until echo -- kicks in)
Last edited by brontosaurusrex (2016-05-30 15:56:14)
Offline
How about this simple script - :
#!/bin/bash
yourURL="http://www.thomasmayet.fr/"
if curl --output /dev/null --silent --head --fail "$yourURL"
then
echo "Online"
else
echo "Offline"
fi
I didn't create one for your second server because I don't have the URL
Conky code: Reused ovh1.sh for both:
OVH 1 is: ${execi 900 ~/bin/ovh1.sh}
OVH 2 is: ${execi 900 ~/bin/ovh1.sh}
Nice and simple!
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Thx a lot
The pool if full !!!
Last edited by sato (2016-05-30 16:21:40)
Offline
You're welcome. YES! Water is better than concrete.
Now you can do this:
Server OVH 1: ${if_match "${execi 900 ~/bin/ovh1.sh}"=="Online"}${alignr}Up: 33.57 GB${else}${alignr}Down${endif}
Server OVH 2: ${if_match "${execi 900 ~/bin/ovh2.sh}"=="Online"}${alignr}Up: 33.57 GB${else}${alignr}Down${endif}
Server OVH 3: ${if_match "${execi 900 ~/bin/ovh3.sh}"=="Online"}${alignr}Up: 33.57 GB${else}${alignr}Down${endif}
ovh1.sh = your server
ovh2.sh = actually checks the Bunsen Forums
ovh3.sh = Doesn't exist - just a test to get "Down".
If you put the code you have for getting the "33.57 GB" in those lines you have what you asked for.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Use red text when its down, please.
Offline
Offline
^ OK - Why? - I would think that's a users option. smile
I thought it was one of the OP's original requests. Scanned the thread again and could not find it.
Has it been edited or is it a figment?
I'd prefer one of the angry faces as well.
Offline
I'd say 'a figment of your imagination' - probably a subliminal message from the colour choices in the OP that caused it.
Font: Face off! - among others.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
I have a ssh access on both server.
passwordless, with ssh keys? if not, you should. it's much safer than with a password.
and you should request sensitive information about your server through ssh, and not through the www.
so, once you have ssh and the keys set up, all you need to do is sth like:
${execi 60 ssh <myserver> du -hs}
in your conky.
Offline
^ catalogued in case I ever find myself with a server. Doubt I will but ...
Thank you!
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
sato wrote:I have a ssh access on both server.
passwordless, with ssh keys? if not, you should. it's much safer than with a password.
and you should request sensitive information about your server through ssh, and not through the www.so, once you have ssh and the keys set up, all you need to do is sth like:
${execi 60 ssh <myserver> du -hs}
in your conky.
Outstanding, I never thought of doing something like this. I'm going to give it a go when I get home. Cloud server with SSH + Key waiting to be tested on...
Lenovo IdeaPad Yoga 13 | BunsenLabs Hydrogen (x64)
Intel Core i7-3537U | Intel HD4000 | 8GB DDR3 | 256GB SSD
Offline
^ OK - Why? - I would think that's a users option. smile
I thought it was one of the OP's original requests. Scanned the thread again and could not find it.
Has it been edited or is it a figment?I'd prefer one of the angry faces as well.
The original post has color coded text; not sure if the op is trying to imply anything though.
May I suggest that once this is all figured out, the op - and Eraph apparently - post the results in the "show your conky" thread; wanting conky to display information from a server comes up periodically so I can see where a lot of people will finds the results useful.
You must unlearn what you have learned.
-- yoda
Offline
Okay, I managed to VNC onto my lappy and the following seems to work well, but I wonder if there's a more elegant way to do this? if_match doesn't seem that well suited (but it does work), and maybe du -hs isn't the best command to run (but it does work). Actual users/addresses obfuscated
Server Status:${if_match "${execi 60 ssh -p 1234 user@server.com du -hs}"==""}${alignr}${color4}Offline${else}${alignr}${color2}Online${endif}
Lenovo IdeaPad Yoga 13 | BunsenLabs Hydrogen (x64)
Intel Core i7-3537U | Intel HD4000 | 8GB DDR3 | 256GB SSD
Offline
^ does this little script work for you?
Two posts down from there is a working example.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
^ does this little script work for you?
Two posts down from there is a working example.
I did see it, and even drew inspiration from it, but I like the connect-by-ssh approach (maybe off-topic, but hey )
Lenovo IdeaPad Yoga 13 | BunsenLabs Hydrogen (x64)
Intel Core i7-3537U | Intel HD4000 | 8GB DDR3 | 256GB SSD
Offline
OH not off topic ... it's another solution for sato as well.
Options are always a good thing
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline