Giter VIP home page Giter VIP logo

zabbix-template-for-varnish-cache's Introduction

This is a Zabbix template + script useful to monitor Varnish Cache Plus instances:

  1. Copy zabbix-varnish-cache.py to /usr/local/bin/.

  2. Add the varnish.discovery and varnish.stats user parameters to Zabbix:

    UserParameter=varnish.discovery[*],sudo /usr/local/bin/zabbix-varnish-cache.py -i '$1' discover $2
    UserParameter=varnish.stats[*],sudo /usr/local/bin/zabbix-varnish-cache.py -i '$1' stats
    

    You'll have to grant zabbix user sudo permissions to execute /usr/local/bin/zabbix-varnish-cache.py in order to let the script perform varnishadm commands to discover the current active VCL, discover healthiness of each backend, etc.

    If you'd rather not use sudo, then add zabbix user to the varnish group in order for the script to be able to retrieve as much data as possible:

    $ sudo usermod -a --groups varnish zabbix
    
  3. Import the template. You may download the appropriate version from the releases page or generate it using the Jinja2 skeleton:

    $ pip install jinja2-cli
    $ PYTHONPATH=. jinja2 \
        -D version={6.0,6.2,6.4,7.0} \
        [-D name='Varnish Cache'] \
        [-D description=''] \
        [-D release='trunk'] \
        --extension=extensions.zabbix.ZabbixExtension --strict -o template.xml template-app-varnish-cache.j2
    
  4. Link hosts to the template. Beware you must set a value for the {$VARNISH_CACHE.LOCATIONS} macro (comma-delimited list of Varnish Cache Plus instance names). Usually you should leave its value blank when running a single Varnish Cache Plus instance per server. Additional macros and contexts are available for further customizations.

zabbix-template-for-varnish-cache's People

Contributors

carlosabalde avatar davidfb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zabbix-template-for-varnish-cache's Issues

Send function removal

Hi there,

Just wondering why the send function has been removed? and how I'm supposed to send the output over to zabbix?

I know I'm a bit behind the times with this question, but i've been using a version from years back to monitor varnish 4x and just got round to having a play with varnish 6.

Cheers,
Benny

zabbix-varnish-cache.py Command failed with error code 102 JSON unimplemented

Hello all, When i run the zabbix-varnish-cache.py file i get the following error. After the error all looks fine but zabbix complains about the output not beeing JSON.

root@varnish-staging:/usr/local/bin # ./zabbix-varnish-cache.py -i '' send -c /usr/local/etc/zabbix/zabbix_agentd.conf
Command failed with error code 102
JSON unimplemented

  • varnish.stat["","MAIN.fetch_head"] 1542121939 0

  • varnish.stat["","VBE.webserver10.fail_enetunreach"] 1542121939 0

  • varnish.stat["","MAIN.sess_dropped"] 1542121939 0

  • varnish.stat["","VBE.shared10.unhealthy"] 1542121939 0

  • varnish.stat["","VBE.flib01.beresp_hdrbytes"] 1542121939 0

  • varnish.stat["","VBE.shared12.pipe_in"] 1542121939 0
    ........

  • varnish.stat["","VBE.bekijk04.fail_eaddrnotavail"] 1542122165 0

  • varnish.stat["","VBE.webserver09.unhealthy"] 1542122165 0
    info from server: "processed: 0; failed: 250; total: 250; seconds spent: 0.003921"
    info from server: "processed: 0; failed: 2; total: 2; seconds spent: 0.000093"
    sent: 252; skipped: 0; total: 252

This is on FreeBSD 11.2
Thanks for your time.

regards
Johan

Problems with execution

Hi, When I try to execute the python script I'm presented with the following error, can someone help?

image

item value failed

Hi thank you for the special script,

I have one question about value of the item .

zabbix 2.x
Varnish 4.1.x

If I execute this command , some item is failed.

/usr/local/sbin/varnish_status.py send -c /etc/zabbix_agent.conf -z ZabbixServerIP -s Hostname

info from server: "processed: 73; failed: 26; total: 99; seconds spent: 0.000917"
sent: 99; skipped: 0; total: 99

How can I checked what failed items?

I already set the templates.xml in the zabbix server.

best regards

Running discovery backends returns empty json

Running the discovery manually produces this output

[root@e ~]# /usr/local/bin/zabbix-varnish-cache.py -n e.varnish.web.tv2net.dk discover backends
{
"data": []
}

It looks like the regex in discovery->backends doesn't like our backend names ?!

Name after "service varnish restart"
"VBE.boot.web17.beresp_bodybytes":

Name after "service varnish reload"
"VBE.reload_2016-03-15T11:08:18.web17.bereq_bodybytes":

Question for send option

Sorry for troubling you - I've got a question for the send option.

zabbix-varnish-cache.py line 115

row = '- varnish.stat["%(key)s"] %(tst)d %(value)d\n' % {

What is the idea with the - infront of varnish.stat? To add a delimiter for a cut option?

Thanks,
Kristian

Zabbix 3.4 compatibility?

Are you aware of any problems arising from an upgrade to version 3.4.? I haven't investigated it yet, but no data is received by zabbix server since this upgrade.

info from server: "processed: 0; failed: 229; total: 229; seconds spent: 0.002343"
sent: 229; skipped: 0; total: 229

Skiping acces zabbix-varnish-cache.py to "_.secret"

For security reason I don't have acces to file /var/lib/varnish/lab1//_.secret
There is a way to skip this file in zabbix-varnish-cache.py ?

zabbix@lab /var/lib/zabbix/externalscripts $ ./zabbix-varnish-cache.py -i '' discover backends
Cannot open "/var/lib/varnish/lab1//_.secret": Permission denied

python script exception

Hi there !
Trying to run /usr/local/bin/zabbix-varnish-cache.py ,
I got the following error:
/usr/local/bin/zabbix-varnish-cache.py
File "/usr/local/bin/zabbix-varnish-cache.py", line 239
for key, value in result.items()
^
SyntaxError: invalid syntax

I'm running python 2.3 on centos 6.4

"Invalid" JSON

Hi Guys,

Really liking the look of this project. I've made the fix outlined in #6 and the script is returning nicely.

I noticed I'm getting:

info from server: "processed: 0; failed: 89; total: 89; seconds spent: 0.000542" sent: 89; skipped: 0; total: 89

Running the command as:

/usr/local/bin/zabbix-varnish-cache.py -i '' send -c /etc/zabbix/zabbix_agentd.conf -s hostname``

The Zabbix (3.0) Front-end says the value needs to be valid JSON. I put the server into debug and captured what the host was sending and the output looks fine in a JSON validator.

This is the user params entry:

[root@cache-01 ~]$ cat /etc/zabbix/zabbix_agentd.d/userparameter_varnish.conf UserParameter=varnish.discovery[*],/usr/local/bin/zabbix-varnish-cache.py -i '$1' discover $2

The only thing I'm not too sure on is the $VARNISH_CACHE_LOCATIONS macro. I saw the host has inherited this macro from the template and it doesn't have a value, but the instructions say this should be blank if there is only one Instance running on the server. Does this mean to just leave it without a value?

Thanks,

Anton

had to change -s dev to -s $HOSTNAME

Hi,
I had to change the cron job from -s dev to -s $HOSTNAME for it to work properly.
Is this a but or just something not specified in the readme ?

Cheers,

Jef

Which location did i define for {$VARNISH_CACHE.LOCATIONS}

I want to monitor, discovery rules but, when i try to give {$VARNISH_CACHE.LOCATIONS} => /var/lib/varnish/; Zabbix already says "Unsupported Item key" for Discovery rules. Which location did i define for this macro.

Thanks for your help.

Incompatible with Zabbix v3 with encryption

I know this script is for Zabbix 2.4 but in case you plan to upgrade to v3, if you have encryption enabled on the server then the zabbix_sender needs to be configurable with the necessary parameters.

no data at Zabbix-frontend

Sorry i couldn't make it work so far.
My Zabbix server version is 3.4.7, varnish version is 4.1 and i am using correct 4.1 branch files.
Varnish discovery is enabled. http://prntscr.com/l5gak1
I have added "UserParameter=varnish.discovery[*],/usr/local/bin/zabbix-varnish-cache.py -i '$1' discover $2" in /etc/zabbix/zabbix_agentd.conf of varnish server
But when i run /usr/local/bin/zabbix-varnish-cache.py python script, it shows me the following error.
....
....

  • varnish.stat["amstelveen","MAIN.sess_drop"] 1539378016 0
  • varnish.stat["amstelveen","VBE.default.beresp_bodybytes"] 1539378016 38235
  • varnish.stat["amstelveen","VBE.default.healthy"] 1539378016 1
  • varnish.stat["amstelveen","VBE.default.pipe_out"] 1539378016 0
    zabbix_sender [1385]: DEBUG: answer [{"response":"success","info":"processed: 0; failed: 91; total: 91; seconds spent: 0.000673"}]
    info from server: "processed: 0; failed: 91; total: 91; seconds spent: 0.000673"
    sent: 91; skipped: 0; total: 91

Please help me.

ValueError: too many values to unpack

Help, please
root@debian:/tmp/zabbix-template-for-varnish-cache# jinja2 \

-D version={4.0,4.2,4.4}
[-D name='Varnish Cache']
[-D lite=0]
--strict -o template.xml template-app-varnish-cache.j2
Traceback (most recent call last):
File "/usr/local/bin/jinja2", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/jinja2cli/cli.py", line 424, in main
sys.exit(cli(opts, args))
File "/usr/local/lib/python2.7/dist-packages/jinja2cli/cli.py", line 241, in cli
template_path, data = args
ValueError: too many values to unpack

Varnish Cache Template problem?

Running Zabbix 2.4.8, Varnish 4.0.3 and trying to monitor Varnish cache.
Checked cron log, zabbix agent log on the client and it seems everything is setup correctly but I don't see any data collected. On the server side every item related with Varnish is enabled except Varnish- Cache hit ratio.

Varnish raw log is not running | Varnish NCSA log is not running

Hello Support,

I have followed installation guide. I setup following cron job on zabbix client/Varnish server.

          • /usr/local/bin/zabbix-varnish-cache.py -i <varnish_host> send -c /etc/zabbix/zabbix_agentd.conf -z -s > /dev/null 2>&1

But On Zabbix server, i can see varnish raw log is not running & Varnish NCSA log is not running. please see here http://prntscr.com/l3i5ek

When i run the python script manually at Varnish server/Zabbix client end, i got these errors
Command failed with error code 106
Invalid flags -j

  • varnish.stat["amstelveen","MAIN.fetch_head"] 1538937297 0
  • varnish.stat["amstelveen","MAIN.sess_dropped"] 1538937297 0
  • varnish.stat["amstelveen","MAIN.s_pipe_hdrbytes"] 1538937297 0
  • varnish.stat["amstelveen","MAIN.fetch_bad"] 1538937297 0
  • varnish.stat["amstelveen","MAIN.cache_miss"] 1538937297 2
  • varnish.stat["amstelveen","MGT.uptime"] 1538937297 348985
    ..
    .....
    .......
  • varnish.stat["amstelveen","VBE.default.beresp_bodybytes"] 1538937857 25533
  • varnish.stat["amstelveen","VBE.default.pipe_out"] 1538937857 0
    info from server: "processed: 0; failed: 90; total: 90; seconds spent: 0.000758"
    sent: 90; skipped: 0; total: 90

Please assist me.

"Value should be a JSON object" discovery error

Hello,

Thanks for the script. I tried and Varnish items discover works just fine but I've got an error both backend discovery and storage discovery. I use Zabbix 3.4.9 and Varnish 4.0.5. Cron output is below. Could you please help me out?

varnish_zabbix

# /usr/local/bin/zabbix-varnish-cache.py -i '' send -c /etc/zabbix/zabbix_agentd.conf -s dev
- varnish.stat["","MAIN.fetch_head"] 1528200188 0
- varnish.stat["","VBE.default\(127.0.0.1\,\,8080\).bereq_hdrbytes"] 1528200188 0
- varnish.stat["","MAIN.sess_dropped"] 1528200188 0
- varnish.stat["","MAIN.sess_readahead"] 1528200188 0
- varnish.stat["","MAIN.n_gzip"] 1528200188 0
- varnish.stat["","MAIN.client_req_417"] 1528200188 0
- varnish.stat["","MAIN.n_backend"] 1528200188 1
- varnish.stat["","MAIN.backend_busy"] 1528200188 0
- varnish.stat["","MAIN.fetch_no_thread"] 1528200188 0
- varnish.stat["","MAIN.threads"] 1528200188 200
- varnish.stat["","MAIN.backend_unhealthy"] 1528200188 0
- varnish.stat["","MAIN.s_pipe_hdrbytes"] 1528200188 0
- varnish.stat["","MAIN.sess_fail"] 1528200188 0
- varnish.stat["","MAIN.s_pipe_out"] 1528200188 0
- varnish.stat["","MAIN.sess_conn"] 1528200188 0
- varnish.stat["","MAIN.losthdr"] 1528200188 0
- varnish.stat["","MAIN.bans_lurker_obj_killed"] 1528200188 0
- varnish.stat["","MAIN.fetch_bad"] 1528200188 0
- varnish.stat["","MAIN.fetch_304"] 1528200188 0
- varnish.stat["","MAIN.fetch_1xx"] 1528200188 0
- varnish.stat["","MAIN.backend_reuse"] 1528200188 0
- varnish.stat["","MAIN.n_purges"] 1528200188 0
- varnish.stat["","MAIN.sess_closed"] 1528200188 0
- varnish.stat["","MAIN.cache_miss"] 1528200188 0
- varnish.stat["","MAIN.s_req_bodybytes"] 1528200188 0
- varnish.stat["","MAIN.backend_req"] 1528200188 0
- varnish.stat["","VBE.default\(127.0.0.1\,\,8080\).beresp_bodybytes"] 1528200188 0
- varnish.stat["","MAIN.threads_destroyed"] 1528200188 0
- varnish.stat["","MAIN.s_pipe_in"] 1528200188 0
- varnish.stat["","VBE.default\(127.0.0.1\,\,8080\).beresp_hdrbytes"] 1528200188 0
- varnish.stat["","MAIN.bans_obj_killed"] 1528200188 0
- varnish.stat["","MAIN.fetch_eof"] 1528200188 0
- varnish.stat["","MAIN.s_fetch"] 1528200188 0
- varnish.stat["","MAIN.fetch_failed"] 1528200188 0
- varnish.stat["","STG.SMA.Transient.g_space"] 1528200188 0
- varnish.stat["","VBE.default\(127.0.0.1\,\,8080\).pipe_hdrbytes"] 1528200188 0
- varnish.stat["","MAIN.n_obj_purged"] 1528200188 0
- varnish.stat["","MAIN.cache_hit"] 1528200188 0
- varnish.stat["","MAIN.bans"] 1528200188 1
- varnish.stat["","MAIN.cache_hitpass"] 1528200188 0
- varnish.stat["","STG.SMA.Transient.c_fail"] 1528200188 0
- varnish.stat["","VBE.default\(127.0.0.1\,\,8080\).healthy"] 1528200188 0
- varnish.stat["","VBE.default\(127.0.0.1\,\,8080\).bereq_bodybytes"] 1528200188 0
- varnish.stat["","MAIN.backend_retry"] 1528200188 0
- varnish.stat["","MAIN.busy_wakeup"] 1528200188 0
- varnish.stat["","MAIN.s_resp_bodybytes"] 1528200188 0
- varnish.stat["","VBE.default\(127.0.0.1\,\,8080\).pipe_in"] 1528200188 0
- varnish.stat["","MAIN.threads_failed"] 1528200188 0
- varnish.stat["","MAIN.s_req_hdrbytes"] 1528200188 0
- varnish.stat["","MAIN.n_lru_nuked"] 1528200188 0
- varnish.stat["","MAIN.esi_warnings"] 1528200188 0
- varnish.stat["","STG.SMA.s0.g_space"] 1528200188 268435456
- varnish.stat["","MAIN.n_objectcore"] 1528200188 0
- varnish.stat["","MAIN.s_pipe"] 1528200188 0
- varnish.stat["","MAIN.threads_created"] 1528200188 200
- varnish.stat["","MAIN.n_objecthead"] 1528200188 0
- varnish.stat["","MAIN.s_resp_hdrbytes"] 1528200188 0
- varnish.stat["","MAIN.client_req_400"] 1528200188 0
- varnish.stat["","MAIN.backend_recycle"] 1528200188 0
- varnish.stat["","MGT.uptime"] 1528200188 563
- varnish.stat["","STG.SMA.s0.g_bytes"] 1528200188 0
- varnish.stat["","MAIN.thread_queue_len"] 1528200188 0
- varnish.stat["","MAIN.client_req"] 1528200188 0
- varnish.stat["","MAIN.sess_drop"] 1528200188 0
- varnish.stat["","MAIN.fetch_length"] 1528200188 0
- varnish.stat["","MAIN.fetch_chunked"] 1528200188 0
- varnish.stat["","MAIN.s_synth"] 1528200188 0
- varnish.stat["","STG.SMA.Transient.g_bytes"] 1528200188 0
- varnish.stat["","MAIN.s_pass"] 1528200188 0
- varnish.stat["","VBE.default\(127.0.0.1\,\,8080\).happy"] 1528200188 0
- varnish.stat["","MAIN.sess_queued"] 1528200188 0
- varnish.stat["","MAIN.n_object"] 1528200188 0
- varnish.stat["","MAIN.backend_conn"] 1528200188 0
- varnish.stat["","MAIN.fetch_204"] 1528200188 0
- varnish.stat["","MAIN.n_expired"] 1528200188 0
- varnish.stat["","MAIN.n_gunzip"] 1528200188 0
- varnish.stat["","MAIN.busy_sleep"] 1528200188 0
- varnish.stat["","MAIN.esi_errors"] 1528200188 0
- varnish.stat["","MAIN.uptime"] 1528200188 563
- varnish.stat["","VBE.default\(127.0.0.1\,\,8080\).pipe_out"] 1528200188 0
- varnish.stat["","MAIN.s_sess"] 1528200188 0
- varnish.stat["","MAIN.threads_limited"] 1528200188 0
- varnish.stat["","MAIN.backend_fail"] 1528200188 0
- varnish.stat["","STG.SMA.s0.c_fail"] 1528200188 0
info from server: "processed: 0; failed: 84; total: 84; seconds spent: 0.000721"
sent: 84; skipped: 0; total: 84

no json data on varnish.discovery

root@zabbix:# zabbix_get -s IP-agent -k varnish.discovery["","items"]
{
"data": [
{
"{#LOCATION_ID}": "",
"{#LOCATION}": ""
}
]
}
root@zabbix:
# zabbix_get -s IP-agent -k varnish.discovery["","items"]
{
"data": [
{
"{#LOCATION_ID}": "",
"{#LOCATION}": ""
}
]
}
root@zabbix:# zabbix_get -s IP-agent -k varnish.discovery["","counters"]
{
"data": []
}
root@zabbix:
# zabbix_get -s IP-agent-k varnish.discovery["","storages"]
{
"data": [
{
"{#LOCATION_ID}": "",
"{#LOCATION}": "",
"{#SUBJECT_ID}": "SMA.Transient",
"{#SUBJECT}": "SMA.Transient"
},
{
"{#LOCATION_ID}": "",
"{#LOCATION}": "",
"{#SUBJECT_ID}": "SMA.s0",
"{#SUBJECT}": "SMA.s0"
}
]
}

Command failed with error code 106 Invalid flags -j [failed: 90]

/usr/local/bin/zabbix-varnish-cache.py -i 'amstelveen' send -c /etc/zabbix/zabbix_agentd.conf -z <zabbix_hostname> -s <zabbix_hostname>

Command failed with error code 106
Invalid flags -j

  • varnish.stat["","MAIN.fetch_head"] 1538937376 0
  • varnish.stat["","MAIN.sess_dropped"] 1538937376 0
  • varnish.stat["","MAIN.s_pipe_hdrbytes"] 1538937376 0
  • varnish.stat["","MAIN.fetch_bad"] 1538937376 0
  • varnish.stat["","MAIN.cache_miss"] 1538937376 2
  • varnish.stat["","MGT.uptime"] 1538937376 349064
  • varnish.stat["","MAIN.fetch_no_thread"] 1538937376 0
  • varnish.stat["","VBE.default.req"] 1538937376 2
  • varnish.stat["","MAIN.n_objecthead"] 1538937376 0
  • varnish.stat["","MAIN.s_req_bodybytes"] 1538937376 0
  • varnish.stat["","MAIN.threads_destroyed"] 1538937376 0
  • varnish.stat["","MAIN.thread_queue_len"] 1538937376 0
  • varnish.stat["","MAIN.fetch_none"] 1538937376 0
  • varnish.stat["","MAIN.fetch_length"] 1538937376 0
  • varnish.stat["","MAIN.fetch_chunked"] 1538937376 2
  • varnish.stat["","MAIN.s_pass"] 1538937376 0
  • varnish.stat["","MAIN.n_expired"] 1538937376 2
  • varnish.stat["","VBE.default.beresp_hdrbytes"] 1538937376 2934
  • varnish.stat["","MAIN.esi_errors"] 1538937376 0
  • varnish.stat["","MAIN.threads_limited"] 1538937376 0
  • varnish.stat["","MAIN.n_gzip"] 1538937376 0
  • varnish.stat["","MAIN.backend_unhealthy"] 1538937376 0
  • varnish.stat["","MAIN.sess_closed_err"] 1538937376 0
  • varnish.stat["","MAIN.fetch_304"] 1538937376 0
  • varnish.stat["","MAIN.backend_reuse"] 1538937376 0
  • varnish.stat["","MAIN.sess_closed"] 1538937376 2
  • varnish.stat["","MAIN.cache_hit"] 1538937376 0
  • varnish.stat["","MAIN.bans"] 1538937376 1
  • varnish.stat["","MAIN.client_req_400"] 1538937376 0
  • varnish.stat["","MAIN.threads_failed"] 1538937376 0
  • varnish.stat["","MAIN.s_resp_hdrbytes"] 1538937376 1466
  • varnish.stat["","STG.SMA.Transient.g_bytes"] 1538937376 0
  • varnish.stat["","VBE.default.conn"] 1538937376 0
  • varnish.stat["","MAIN.busy_sleep"] 1538937376 0
  • varnish.stat["","VBE.default.pipe_in"] 1538937376 0
  • varnish.stat["","MAIN.client_req_417"] 1538937376 0
  • varnish.stat["","MAIN.threads"] 1538937376 200
  • varnish.stat["","MAIN.n_backend"] 1538937376 1
  • varnish.stat["","MAIN.busy_wakeup"] 1538937376 0
  • varnish.stat["","STG.SMA.Transient.c_fail"] 1538937376 0
  • varnish.stat["","MAIN.s_pipe"] 1538937376 0
  • varnish.stat["","MAIN.sess_fail"] 1538937376 0
  • varnish.stat["","MAIN.uptime"] 1538937376 349065
  • varnish.stat["","MAIN.bans_lurker_obj_killed"] 1538937376 0
  • varnish.stat["","MAIN.fetch_failed"] 1538937376 0
  • varnish.stat["","MAIN.n_purges"] 1538937376 0
  • varnish.stat["","MAIN.s_pipe_in"] 1538937376 0
  • varnish.stat["","MAIN.s_fetch"] 1538937376 2
  • varnish.stat["","MAIN.fetch_204"] 1538937376 0
  • varnish.stat["","MAIN.bans_obj_killed"] 1538937376 0
  • varnish.stat["","MAIN.s_synth"] 1538937376 0
  • varnish.stat["","MAIN.esi_warnings"] 1538937376 0
  • varnish.stat["","MAIN.n_objectcore"] 1538937376 0
  • varnish.stat["","MAIN.backend_fail"] 1538937376 0
  • varnish.stat["","STG.SMF.s0.g_space"] 1538937376 1073741824
  • varnish.stat["","MAIN.busy_killed"] 1538937376 0
  • varnish.stat["","MAIN.client_req"] 1538937376 2
  • varnish.stat["","STG.SMF.s0.c_fail"] 1538937376 0
  • varnish.stat["","VBE.default.bereq_hdrbytes"] 1538937376 964
  • varnish.stat["","VBE.default.happy"] 1538937376 0
  • varnish.stat["","MAIN.sess_queued"] 1538937376 0
  • varnish.stat["","MAIN.backend_conn"] 1538937376 2
  • varnish.stat["","STG.SMA.Transient.g_space"] 1538937376 0
  • varnish.stat["","VBE.default.bereq_bodybytes"] 1538937376 0
  • varnish.stat["","MAIN.s_sess"] 1538937376 2
  • varnish.stat["","MAIN.s_pipe_out"] 1538937376 0
  • varnish.stat["","MAIN.sess_readahead"] 1538937376 0
  • varnish.stat["","MAIN.cache_hit_grace"] 1538937376 0
  • varnish.stat["","MAIN.backend_busy"] 1538937376 0
  • varnish.stat["","MAIN.n_lru_nuked"] 1538937376 0
  • varnish.stat["","MAIN.sess_conn"] 1538937376 2
  • varnish.stat["","MAIN.losthdr"] 1538937376 0
  • varnish.stat["","MAIN.fetch_1xx"] 1538937376 0
  • varnish.stat["","MAIN.cache_hitpass"] 1538937376 0
  • varnish.stat["","MAIN.backend_req"] 1538937376 2
  • varnish.stat["","VBE.default.pipe_hdrbytes"] 1538937376 0
  • varnish.stat["","MAIN.fetch_eof"] 1538937376 0
  • varnish.stat["","MAIN.n_lru_limited"] 1538937376 0
  • varnish.stat["","MAIN.n_obj_purged"] 1538937376 0
  • varnish.stat["","MAIN.backend_retry"] 1538937376 0
  • varnish.stat["","MAIN.s_resp_bodybytes"] 1538937376 25533
  • varnish.stat["","STG.SMF.s0.g_bytes"] 1538937376 0
  • varnish.stat["","MAIN.s_req_hdrbytes"] 1538937376 970
  • varnish.stat["","MAIN.backend_recycle"] 1538937376 2
  • varnish.stat["","MAIN.n_object"] 1538937376 0
  • varnish.stat["","MAIN.threads_created"] 1538937376 200
  • varnish.stat["","MAIN.n_gunzip"] 1538937376 2
  • varnish.stat["","MAIN.sess_drop"] 1538937376 0
  • varnish.stat["","VBE.default.beresp_bodybytes"] 1538937376 25533
  • varnish.stat["","VBE.default.pipe_out"] 1538937376 0
    info from server: "processed: 0; failed: 90; total: 90; seconds spent: 0.000633"
    sent: 90; skipped: 0; total: 90

Could not get hold of varnishd, is it running?

Sorry, but i can't started script

root@debian:~# sudo -u zabbix sudo /usr/local/bin/zabbix-varnish-cache.py --varnish-instances 127.0.0.1 stats
.....
Could not get hold of varnishd, is it running?
.....
Could not get hold of varnishd, is it running?

I added string to sudoers
zabbix ALL= (ALL) NOPASSWD: /usr/local/bin/zabbix-varnish-cache.py

and

chmod +x /usr/local/bin/zabbix-varnish-cache.py,
sudo usermod -a --groups varnish zabbix,
sudo usermod -a --groups varnish root

and not working. What I need doing else?
Thanks

Problem with template for zabbix 4.0 and 4.2

For zabbix 4.4 work
For zabbix 4.0 and 4.2 I have this error:

root@lab:~/zabbix-template-for-varnish-cache# /usr/local/bin/jinja2 -D version=4.0 --strict -o template.xml template-app-varnish-cache.j2 Traceback (most recent call last): File "/usr/local/bin/jinja2", line 10, in <module> sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/jinja2cli/cli.py", line 424, in main sys.exit(cli(opts, args)) File "/usr/local/lib/python2.7/dist-packages/jinja2cli/cli.py", line 314, in cli out.write(render(template_path, data, extensions, opts.strict)) File "/usr/local/lib/python2.7/dist-packages/jinja2cli/cli.py", line 229, in render return env.get_template(os.path.basename(template_path)).render(data) File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/root/zabbix-template-for-varnish-cache/template-app-varnish-cache.j2", line 630, in top-level template code {{ discovery_rule( File "/usr/local/lib/python2.7/dist-packages/jinja2/runtime.py", line 579, in _invoke rv = self._func(*arguments) File "/root/zabbix-template-for-varnish-cache/template-app-varnish-cache.j2", line 312, in template {{ trigger(definition) }} File "/usr/local/lib/python2.7/dist-packages/jinja2/runtime.py", line 579, in _invoke rv = self._func(*arguments) File "/root/zabbix-template-for-varnish-cache/template-app-varnish-cache.j2", line 136, in template <recovery_mode>{{ trigger_priority('EXPRESSION') }}</recovery_mode> File "/usr/local/lib/python2.7/dist-packages/jinja2/runtime.py", line 579, in _invoke rv = self._func(*arguments) File "/root/zabbix-template-for-varnish-cache/template-app-varnish-cache.j2", line 45, in template }[name] }} jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'EXPRESSION'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.