contrib icon indicating copy to clipboard operation
contrib copied to clipboard

varnish4_ not working with varnish 5.2

Open stbc opened this issue 6 years ago • 13 comments

After upgrading our varnish box to 5.2 the munin plugin varnish4 stopped working. Output of munin-node.log:

2017/09/19-01:25:05 [9833] Error output from varnish4_data_structures:
2017/09/19-01:25:05 [9833]      No such aspect
2017/09/19-01:25:05 [9833]      Known arguments: suggest, config, autoconf.
2017/09/19-01:25:05 [9833]      Run with suggest to get a list of known aspects.
2017/09/19-01:25:05 [9833] Service 'varnish4_data_structures' exited with status 1/0.
2017/09/19-01:25:05 [9833] Error output from varnish4_data_structures:
2017/09/19-01:25:05 [9833]      No such aspect
2017/09/19-01:25:05 [9833]      Known arguments: suggest, config, autoconf.
2017/09/19-01:25:05 [9833]      Run with suggest to get a list of known aspects.
2017/09/19-01:25:05 [9833] Service 'varnish4_data_structures' exited with status 1/0.

stbc avatar Sep 19 '17 07:09 stbc

See remark in upgrading document from varnish-cache.org: https://varnish-cache.org/docs/5.2/whats-new/upgrading-5.2.html

stbc avatar Sep 19 '17 07:09 stbc

The above error (No such aspect) is probably caused by an invalid symlink suffix (see the definition of my %ASPECTS in the plugin). I guess, this is not related to your varnish upgrade.

You may want to run munin-run NAME for the different varnish symlinks in your installation. This will help you spot the error.

Regarding the upgrade notes you linked: did you want to refer to something specific?

sumpfralle avatar Sep 19 '17 23:09 sumpfralle

Thx for the comment.

´munin-run varnish4_uptime´ produces nothing. No error on stdout, no log entry. Same for other symlinks. Links are fine, there was no change. We came from varnish 5.1.3 (munin working) and are now using 5.2. The upgrade notes state in the very first paragraph:

There are extensive changes under the hood with respect to statistics counters, but these should all be transparent at the user-level.

stbc avatar Sep 20 '17 06:09 stbc

Links are fine, there was no change.

In this case I assume, that the error messages above are not related to the problem that you are experiencing. Take a look at these lines of code in the plugin:

        if (!defined($ASPECTS{$graph})) {
                usage "No such aspect";
        }

Here the "symlink suffix" is checked against the keys of a statically defined dictionary (ASPECTS). Thus this error message is very likely not related to a varnish upgrade. (I just want to avoid hunting unrelated ghosts effects)

Maybe you want to share the output of varnishstat -x before and after the upgrade with us? This seems to be the sole source of information for the plugin.

sumpfralle avatar Sep 20 '17 11:09 sumpfralle

Ah, that narrows it down! That is the output of varnishstat -x (varnish 5.1.3) for uptime

...
	<stat>
		<type>MAIN</type>
		<name>uptime</name>
		<value>1140690</value>
		<flag>c</flag>
		<format>d</format>
		<description>Child process uptime</description>
	</stat>
...

And this is for 5.2:

...
	<stat>
		<name>MGT.uptime</name>
		<value>285410</value>
		<flag>c</flag>
		<format>d</format>
		<description>Management process uptime</description>
	</stat>
...

Naming has changed, Munin is looking for

...
	'uptime' => {
		'title' => 'Varnish uptime',
		'vlabel' => 'days',
		'scale' => 'no',
		'values' => {
			'uptime' => {
				'type' => 'GAUGE',
				'cdef' => 'uptime,86400,/'
			}
		}
	},
...

stbc avatar Sep 21 '17 11:09 stbc

Wouldn't it be more effective to trigger the values by using?: varnishstat -1 instead of varnishstat -x

justnx avatar Sep 22 '17 13:09 justnx

Maybe the author of this plugin could tell - but I don't know :)

Pull requests are really highly appreciated. The topics covered by the plugins in this repository a way too broad to be handled by our small group of maintainers on a detailed technical level. We merely review and handle contributions and do a bit of cleanup. Thus: please feel free to improve this plugin!

sumpfralle avatar Sep 22 '17 22:09 sumpfralle

Maybe it's because of: http://munin-monitoring.org/ticket/1272

reduardo7 avatar Jan 22 '18 13:01 reduardo7

varnish5 didn't know the field ident anymore. The ident ist join to the name part so you have to split the name value to get the ident part. I have do it with my little knowledge of perl. Look to the attached file.

varnish5_.txt

araneolus avatar Mar 09 '18 14:03 araneolus

There is alreday a fix, see the pull request above your post...

You are pointing out to ? with the reference of "little knowledge"?

mobil versendet Am 9. März 2018 15:21:45 schrieb araneolus [email protected]:

varnish5 didn't know the field ident anymore. The ident ist join to the name part so you have to split the name value to get the ident part. I have do it with my little knowledge of perl. Look to the attached file.

varnish5_.txt

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/munin-monitoring/contrib/issues/876#issuecomment-371825237

stbc avatar Mar 09 '18 14:03 stbc

Yes, I see it now :-( RTF Comments :-)

araneolus avatar Mar 09 '18 14:03 araneolus

Stale issue message

github-actions[bot] avatar Apr 17 '21 02:04 github-actions[bot]

I don't understand why this was reopened.. There is currently a varnish5_ plugin which was merged in:

https://github.com/munin-monitoring/contrib/blob/master/plugins/varnish/varnish5_

lelutin avatar Jan 09 '22 19:01 lelutin