Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Realtime bandwidth monitoring with Nagios

    Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
    1 Posts 1 Posters 1.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      eroji
      last edited by

      I wrote these little scripts for monitoring my realtime DL/UL pfsense bandwidth for Nagios and graph them. It can be done with a single script using bash but I decided to use it as an opportunity to brush up my Python. The Python script purely outputs the Mbit/s only and the bash script handles text output and exit codes and Nagios perfdata for graphing. There seems to be a problem with the SNMP octet readout occasionally which causes the speed calculation to yield a negative number, so I made the bash script to output UNKNOWN in those cases so the graph does not get jacked up.

      You will need to edit the bash script slightly to identify the location of Python binary, location of Python script and your max bandwidth.

      Examples:
      ./pfsense_bandwidth <hostname>public ifInOctets. <interface number="">./pfsense_bandwidth.py -H <hostname>-C public -I ifInOctets. <interface.number>pfsense_bandwidth.zip</interface.number></hostname></interface></hostname>

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.