Loading ...
Sorry, an error occurred while loading the content.

ocaml munin plugin example

Expand Messages
  • Mihamina Rakotomandimby
    Hi all, A quick and dirty Munin plugin I currently use to monitor my traffic consumption: http://is.gd/2tUKFM I have a limited plan (3GB) on an USB 3G stick
    Message 1 of 1 , Sep 6, 2011
    • 0 Attachment
      Hi all,

      A quick and dirty Munin plugin I currently use to monitor my traffic
      consumption: http://is.gd/2tUKFM

      I have a limited plan (3GB) on an USB 3G stick (ppp0 interface), better
      to monitor it.

      I store the ppp0 RX and TX traffic in a SQLite3 database in a 5 min
      basis with a cron:

      */5 * * * * \
      sqlite3 /home/mihamina/accouting \
      "INSERT INTO ifconfig VALUES(NULL, DATETIME('NOW') \
      $(/sbin/ifconfig ppp0 | sed 's/:/ /g' \
      | awk '/RX bytes/{print ",", $3, "," ,$8, ")"}')"

      Need to store the counters in a persistent way because when
      deconnecting/reconnecting, counters reset.

      I realized later there was an easier way by parsing /proc/net/dev
      instead of parsing ifconfig output. I'll switch to that later.

      I'll blog it later too... :-)

      --
      RMA.
    Your message has been successfully submitted and would be delivered to recipients shortly.