This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get some useful Seafile metrics to be comsumed by Node Exporter's text collector (so that we don't need to write | |
# a separate exporter for Seafile) | |
# Fill in authorization token and server address (see below) and let this script run via cronjob at desired frequency | |
# | |
# Requires curl and jq to be installed (and prometheus-node-exporter, of course) | |
# Assumes there are no more than 1000 users, libraries and devices (otherwise increase per page limit or implement paging) | |
# | |
# If an error is encountered during API call, previous values are preserved and seafile_collector_result metric |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Requires libnet-cidr-lite-perl installed | |
# Best practices | |
set -Eeuo pipefail | |
# Local WAN Interface (using interface, not IP, so that we need not change the script on WAN IP changes) | |
WAN_IFACE='eth0' | |
# Local AS |