- Python pizza status
- Why Gen Y Is Going to Change the Web
- Understanding how you process information to help you get organized, part 2
- OLPC Will Ship With Windows XP
- How to Be On Time Every Time
- Poor Children Of The World No Longer Will Have To Struggle With Linux
- HubSpot Gets $12 Million To Drive Traffic to Your Site
- Google kills Anonymous AdSense account
- Epic Fail....
- Lifehack Digest for May 14
- Debian/Ubuntu users: update your SSL keys and certs
- Information Overload
- Scattered Clouds
- Cleaning Your Display and Keyboard
- Knievel Fail
- New Google Service Turns Web Pages into Networking Sites
- Ice Cream Fail
- Strange Fail
- Obedience Fail
- Scary Clown
Graphing your systems mail queue using cacti
Submitted by rene on Sun, 03/23/2008 - 12:07.
I recently noticed that the mail queue on a busy mail server i maintain was becoming disturbingly long at times.
Graphing a mail queue can be done with a little script and some cacti mojo.
Firstly, create a script that outputs the length of the queue which will be understood by cacti. The output needs to look something like
mailq:17Ive chosen to write a script in python called check_mailq which you can find here. Within cacti, go to the Console and add a 'Data Input Method' with the following attributes.
Name: Get mailq Input Type: Script/Command Input String: [path to your mailq script]Ive used the following path for my Input String
/usr/local/cacti/bin/check_mailqWithin the 'Data Input Method' the 'Input Fields' stays empty though you need to create an 'Output Field' with the following attributes.
Field [Output]: mailq Friendly Name: mailq Update RRD File: [checked]Save the 'Data Input Method' and then create a 'Data Template' using the following attributes
Data Templates Name: mailq Data Source Name: |host_description| - mailq Data Input Method: mailq Data Source Item: mailq Data Source Type: GAUGE Output Field: mailq - mailqSave the 'Data Template' and create a 'Data Source'.
Select Data Template: mailq Host: [select your host]Save the 'Data Source' and create a graph with 'Graph Management'
Selected Graph Template: None Host: [select your host] Title: [insert your hostname] - mailqClick create then click add within the 'Graph Items' section
Data Source: [your hostname] - mailq (mailq) Color: 00FF00 Graph Item Type: AREA Text Format: queued emailsClick create, wait 10 minutes and a graph of your mail queue should appear within the Graphs section of cacti.






















Post new comment