You are not logged in.

#21 2016-05-30 14:41:33

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: Show my web server on conky

As an argument to curl:

curl -L ...

Offline

#22 2016-05-30 14:56:43

sato
Member
From: France
Registered: 2016-05-29
Posts: 14

Re: Show my web server on conky

Ok is working now Thx.

http://www.plixup.com/pics_core3/14646199396746conky3.png

This the code of my PHP File:

http://pastebin.com/t3ZHNgPq

Offline

#23 2016-05-30 15:22:14

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Show my web server on conky

I feel like I jumped off the high diving board only to see an empty pool.  sad


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#24 2016-05-30 15:36:47

sato
Member
From: France
Registered: 2016-05-29
Posts: 14

Re: Show my web server on conky

Sector11 wrote:

I feel like I jumped off the high diving board only to see an empty pool.  sad

No, i've dont make the UP/Down script wink

Offline

#25 2016-05-30 15:44:04

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,737

Re: Show my web server on conky

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

#26 2016-05-30 16:08:54

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Show my web server on conky

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!
2016_05_30_13_05_23_Scrot11.jpg


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#27 2016-05-30 16:21:22

sato
Member
From: France
Registered: 2016-05-29
Posts: 14

Re: Show my web server on conky

Thx a lot wink
The pool if full !!!

Last edited by sato (2016-05-30 16:21:40)

Offline

#28 2016-05-30 16:37:27

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Show my web server on conky

smile  You're welcome.  YES! Water is better than concrete.  lol

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}

http://s20.postimg.org/3p7xwllfx/2016_05_30_13_38_06_Scrot11.jpg

ovh1.sh = your server
ovh2.sh = actually checks the Bunsen Forums smile
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

#29 2016-05-30 16:46:47

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: Show my web server on conky

Use red text when its down, please.

Offline

#30 2016-05-30 18:26:02

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Show my web server on conky

^  OK - Why? - I would think that's a users option.  smile


OFFTOPIC:  To emulate Sheldon Cooper's "Fun with Flags" I give you:

Fun with FONTS!
2016_05_30_15_29_56_Scrot11.jpg I'd chose one of the angry faces.
And back to:     » Show my web server on conky


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#31 2016-05-30 18:38:19

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: Show my web server on conky

^  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. wink

Offline

#32 2016-05-30 19:48:12

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Show my web server on conky

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.  wink


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#33 2016-05-30 19:59:58

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: Show my web server on conky

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.

Offline

#34 2016-05-30 20:05:07

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Show my web server on conky

^ 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

#35 2016-05-30 22:54:54

Eraph
Member
From: /au/qld/bne
Registered: 2016-02-29
Posts: 282
Website

Re: Show my web server on conky

ohnonot wrote:
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

#36 2016-05-30 23:28:09

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,611

Re: Show my web server on conky

xaos52 wrote:

^  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. wink

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

#37 2016-05-31 03:02:36

Eraph
Member
From: /au/qld/bne
Registered: 2016-02-29
Posts: 282
Website

Re: Show my web server on conky

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 smile

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

#38 2016-05-31 03:20:59

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Show my web server on conky

^  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

#39 2016-05-31 04:00:39

Eraph
Member
From: /au/qld/bne
Registered: 2016-02-29
Posts: 282
Website

Re: Show my web server on conky

Sector11 wrote:

^  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 big_smile)


Lenovo IdeaPad Yoga 13 | BunsenLabs Hydrogen (x64)
Intel Core i7-3537U | Intel HD4000 | 8GB DDR3 | 256GB SSD

Offline

#40 2016-05-31 12:19:56

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Show my web server on conky

OH not off topic ... it's another solution for sato as well.

Options are always a good thing  smile


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

Board footer

Powered by FluxBB