Finally, configure Prometheus to scrape the published metrics from CP. Please don't tell our security officer that I'm saying this! python3 -m rverĥ. * * * * * /tmp/cptest/prometheus_metrics.shĤ.and run a simple web server to publish the metrics. Create a cronjob on the gateway to run the script every minute or so. Sed "s//$cp_vpn_count/g" /tmp/cptest/index.template > /tmp/cptest/index.txtģ. #!/bin/bashĬp_vpn_count=`fw tab -t userc_users -s | grep userc | tr -s ' ' | cut -d ' ' -f 4` It probably should have been Python/Jinja2/HTML, it was easier to do with bash/sed/txt. Still on the gateway, a very simple script (prometheus_metrics.sh) to replace the template variables and write the output to a text file (index.txt). # HELP cp_vpn_count Number of VPN connected users.Ģ. On the gateway itself, I created a Prometheus metrics template (index.template). Another quick 'n' dirty solution based on Prometheus:ġ.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |