4

I installed varnish 4.1 and compiled some vmods in a linux (ubuntu14 and centos7). Now I want to check list of installed vmod or loaded vmod to check if they are properly installed, recognized properly by varnish and loaded. I'm aware that # ls -al /usr/lib/varnish/vmods command will list up the vmod files but this does not make sure the vmods are installed/loaded successfully.

While I search varnish reference I found a varnish-counter field called vmods, but it is to show the total number of loaded vmods in varnishstat, and not shows vmods by names. Also, varnishstat command is not suitable for this use case as the command is intended to display one time in stdout, and not keep real time update as varnishstats does.

How to compose command to show list of varnish vmods by names?

2 Answers 2

1

With varnish 7.7 (and probably also older version of v7) you can have a look at the vmod_cache directory. You can find it at /var/lib/varnish/varnishd/vmod_cache on Debian systems, but this might vary on your local system. You will find a copy of all vmods in use since last restart having a unique hash as filename suffix.

Example of the content of a vmod_cache directory:

-r--r--r-- 1 varnish varnish 46K Aug 14 09:17 _vmod_bodyaccess.896ee1d05c2ee9cd65b5d2ffd3d08f8e336a314e5cb261b8cc0fded5040a38e7 -r--r--r-- 1 varnish varnish 67K Aug 14 09:17 _vmod_cookie.4e6b575e5b29a49555cf5a1a842ef310f4bf9b526a25a8c3c815a07348ec1c27 -r--r--r-- 1 varnish varnish 38K Aug 14 09:17 _vmod_dns.3c90369b72aa581bc56a8d1ce449f22f4eb529d5ee748cb6e67b81a75c86e170 -r--r--r-- 1 varnish varnish 45K Aug 14 09:17 _vmod_geoip2.d4f3e94eb0a40163792cb604b03f475f2793827043dc3f812e3867640adbc5ef -r--r--r-- 1 varnish varnish 51K Aug 14 09:17 _vmod_header.0cfa8c330ea4a0842d13b56d0f66945babf4516ec9246f13f0801c1c242c854c -r--r--r-- 1 varnish varnish 539K Aug 14 09:17 _vmod_redis.ecc11799c23fc31ff9f0f5d6e7874937eadf60cc2115bb6a3d0ee85e36eabfbf -r--r--r-- 1 varnish varnish 152K Aug 14 09:17 _vmod_std.38ecfcebb130be06dee4592bdb7d7259cd3c8aa2a1184296defce2e403bcf8aa 
1

Listing loaded vmods is not supported. I suggest you file a bug asking for this, or to get it exposed through the varnishstat interfaces. (varnishstat can be run in oneshot mode by adding the -1 flag.)

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.