Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Misc

Remote access to varnish stats / nagios and varnish

 

 

Varnish misc RSS feed   Index | Next | Previous | View Threaded


oddur at ccpgames

Aug 10, 2012, 4:00 AM

Post #1 of 7 (457 views)
Permalink
Remote access to varnish stats / nagios and varnish

Hi,

I want to monitor some varnishstats (cache hits/misses/bandwith) from my varnish instances with nagios. I've found this https://github.com/varnish/varnish-nagios/commits/master but it seems you are running varnish and nagios on the same machine (or using a npre agent on the varnish box).

What would be ideal for me is to expose a single url that just responds with counter values, possibly just the full output of "varnishstat -x".

Very similar to http://wiki.nginx.org/NginxHttpStubStatusModule for nginx.

If it's possible to access to counter values using inline C, I guess this would be possible using that.

Best regards,

Oddur Snćr Magnússon
Senior Programmer | Reykjavík | Iceland

[Description: Description: Description: Description: cid:DB5C0F43-387B-4CF8-BC6F-B17512BB8251 [at] ccp]

:wq
Attachments: image001.png (10.1 KB)


nkinkade at creativecommons

Aug 10, 2012, 6:47 AM

Post #2 of 7 (442 views)
Permalink
Re: Remote access to varnish stats / nagios and varnish [In reply to]

On Fri, Aug 10, 2012 at 7:00 AM, Oddur Snær Magnússon
<oddur [at] ccpgames> wrote:
>
> Hi,
>
> I want to monitor some varnishstats (cache hits/misses/bandwith) from my varnish instances with nagios. I’ve found this https://github.com/varnish/varnish-nagios/commits/master but it seems you are running varnish and nagios on the same machine (or using a npre agent on the varnish box).
>
> What would be ideal for me is to expose a single url that just responds with counter values, possibly just the full output of “varnishstat –x”.
>
> Very similar to http://wiki.nginx.org/NginxHttpStubStatusModule for nginx.
>
> If it’s possible to access to counter values using inline C, I guess this would be possible using that.
>
> Best regards,
>
> Oddur Snær Magnússon
>
> Senior Programmer | ReykjavĂ­k | Iceland

I feel like I may be missing something in what you're looking for, but
if all you want is a URL that produces the output of `varnishstat -x`,
then it seems trivial to write a practically one line CGI script for
this purpose. Or to have a cron job dump the output to a text file in
your webroot every so often, and then just accessing that file
directly when you need it.

Nathan

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


arboeglin at herffjones

Aug 10, 2012, 8:25 AM

Post #3 of 7 (444 views)
Permalink
RE: Remote access to varnish stats / nagios and varnish [In reply to]

On Fri, Aug 10, 2012 at 09:47:29, Nathan Kinkade wrote:
> Cc: varnish-misc [at] varnish-cache
> Subject: Re: Remote access to varnish stats / nagios and varnish
>
> On Fri, Aug 10, 2012 at 7:00 AM, Oddur Snær Magnússon
> <oddur [at] ccpgames> wrote:
> >
> > Hi,
> >
> > I want to monitor some varnishstats (cache hits/misses/bandwith)
> > from my
> varnish instances with nagios. I’ve found this
> https://github.com/varnish/varnish-nagios/commits/master but it seems
> you are running varnish and nagios on the same machine (or using a
> npre agent on the varnish box).
> >
> > What would be ideal for me is to expose a single url that just
> > responds with
> counter values, possibly just the full output of “varnishstat –x”.
> >
> > Very similar to http://wiki.nginx.org/NginxHttpStubStatusModule for
> nginx.
> >
> > If it’s possible to access to counter values using inline C, I guess
> > this would
> be possible using that.
> >
> > Best regards,
> >
> > Oddur Snær Magnússon
> >
> > Senior Programmer | ReykjavĂ­k | Iceland
>
> I feel like I may be missing something in what you're looking for, but
> if all you want is a URL that produces the output of `varnishstat -x`,
> then it seems trivial to write a practically one line CGI script for
> this purpose. Or to have a cron job dump the output to a text file in
> your webroot every so often, and then just accessing that file directly when you need it.
>
> Nathan
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc [at] varnish-cache
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

I think the most simple option would be to just use the Nagios check_by_ssh plugin to run the varnish-nagios command on the remote system.

Adam



_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


drais at icantclick

Aug 13, 2012, 8:48 AM

Post #4 of 7 (436 views)
Permalink
Re: Remote access to varnish stats / nagios and varnish [In reply to]

On Fri, 10 Aug 2012, Oddur Snær Magnússon wrote:

> What would be ideal for me is to expose a single url that just responds with
> counter values, possibly just the full output of “varnishstat –x”.

Um. Sounds like you want access to the management port.

from the varnishd man page:
-T address[:port]
Offer a management interface on the specified address and port. See Management Interface for
a list of management commands.

https://www.varnish-cache.org/trac/wiki/ManagementPort


For us, -T :6082 does the trick - we poll our stats from there.

echo "stats" | nc $server $port

and parse and go.


--
david raistrick http://www.netmeister.org/news/learn2quote.html
drais [at] icantclick ascii ribbon campaign - stop html mail
http://www.asciiribbon.org/


perbu at varnish-software

Aug 13, 2012, 1:59 PM

Post #5 of 7 (426 views)
Permalink
Re: Remote access to varnish stats / nagios and varnish [In reply to]

On Mon, Aug 13, 2012 at 5:48 PM, david raistrick <drais [at] icantclick>wrote:

> On Fri, 10 Aug 2012, Oddur Snćr Magnússon wrote:
>
> What would be ideal for me is to expose a single url that just responds
>> with
>> counter values, possibly just the full output of “varnishstat –x”.
>>
>
> Um. Sounds like you want access to the management port.
>
> from the varnishd man page:
> -T address[:port]
> Offer a management interface on the specified address and
> port. See Management Interface for
> a list of management commands.
>
> https://www.varnish-cache.org/**trac/wiki/ManagementPort<https://www.varnish-cache.org/trac/wiki/ManagementPort>
>
>
> For us, -T :6082 does the trick - we poll our stats from there.
>
> echo "stats" | nc $server $port
>

and parse and go.
>

The implementation of "stats" wasn't really up to scratch and was ditched
in Varnish 3.0. However, wrapping "varnishstat -1 -x" in a tiny CGI service
is probably a 15 minute job.

--
Per Buer
Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer
*Varnish makes websites fly!*
Whitepapers <http://www.varnish-software.com/whitepapers> |
Video<http://www.youtube.com/watch?v=x7t2Sp174eI> |
Twitter <https://twitter.com/varnishsoftware>


drais at icantclick

Aug 13, 2012, 2:22 PM

Post #6 of 7 (428 views)
Permalink
Re: Remote access to varnish stats / nagios and varnish [In reply to]

On Mon, 13 Aug 2012, Per Buer wrote:

> The implementation of "stats" wasn't really up to scratch and was ditched in
> Varnish 3.0. However, wrapping "varnishstat -1 -x" in a tiny CGI service is
> probably a 15 minute job.

What? really? wtf? stats is gone from the management interface?

Damn good thing we never updated to 3.0...and sounds like we never will.
:(

Network services absolutely -must- provide network interfaces for
statistics polling! IMPO.

While not perfect, the stats interface was significantly better than
-every- other competing product out there. :(




--
david raistrick http://www.netmeister.org/news/learn2quote.html
drais [at] icantclick ascii ribbon campaign - stop html mail
http://www.asciiribbon.org/




_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


perbu at varnish-software

Aug 13, 2012, 10:39 PM

Post #7 of 7 (416 views)
Permalink
Re: Remote access to varnish stats / nagios and varnish [In reply to]

On Mon, Aug 13, 2012 at 11:22 PM, david raistrick <drais [at] icantclick>wrote:

> On Mon, 13 Aug 2012, Per Buer wrote:
>
> The implementation of "stats" wasn't really up to scratch and was ditched
>> in
>> Varnish 3.0. However, wrapping "varnishstat -1 -x" in a tiny CGI service
>> is
>> probably a 15 minute job.
>>
>
> What? really? wtf? stats is gone from the management interface?
>
> Damn good thing we never updated to 3.0...and sounds like we never will. :(
>

There isn't much work going into maintaining the 2.1 branch so I would not
recommend, at least not without paying a bit of attention.

Network services absolutely -must- provide network interfaces for
> statistics polling! IMPO.
>

I'm not sure I agree. Binding varnishstat to a TCP port through xinetd or
another inetd variant is trivial. Also, if you insist on having the stats
command "in line" you could use the varnish agent (
https://github.com/varnish/varnish-agent) which also ads a couple of other
commands into the protocol.


--
Per Buer
Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer
*Varnish makes websites fly!*
Whitepapers <http://www.varnish-software.com/whitepapers> |
Video<http://www.youtube.com/watch?v=x7t2Sp174eI> |
Twitter <https://twitter.com/varnishsoftware>

Varnish misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.