It was a simple request at the Weekly Company Meeting: “Can we monitor
the number of SMTP
connections to our mail servers, and have it graphed in Cacti?” Breaking it down, the answer
appears to be yes, and I have no XXXXXXX
clue.”

And that is bugging the XXXX out of me.

The first bit? Pretty easy actually.

By default, our servers are already tracking SMTP connections via iptables,
and it's a simple matter to pull the number out:

Print the current state of iptables, pull out the line
accepting incoming connections to the SMTP port, and print the first column, which is the
number of packets (and thus, the number of connections).

Next up is to deliver this information via SNMP. We're using net-snmp and it indeed, does
make it easy to export information via SNMP. Take the above command, place it into
a file (thus making it a shell script). Then, in the SNMP configuration file:

I don't fault you for feeling confused. I'm a XXXXXXXXXX programmer who writes CGIs in C for fun, and I got horribly confused.

I can't quite figure out how Cacti works. Oh sure, it's easy to install,
and monitoring devices isn't all that difficult (I find it rather randomly
clunky myself) but adding a new query to Cacti?

If there's a straightforward way of doing that, I haven't found it.

Somehow “Data Queries” are tied to the “Data Templates” although what
that connection is eludes me. It seems like you can specify a single
SNMP query in
a “Data Template” but maybe not, because why have an XML file for the SNMP query?

And the “Graph Templates” tie into this mess as well, although I'm
still puzzled at that one.

And the flow is weird—I'll be in the “Data Query” section,
obstensibly making a change to a “Data Query” and suddenly find myself in
the “Data Template” area after saving a change. Or sometimes in the
“Graph Template” area.

Never the “Host Template” area though.

I'm finding it a horribly confusing process and it's bugging me that I
can't figure this out. I want to quit and say to Smirk, “Sorry, not
possible,” and that is bugging me, because I know it is
possible, probably even with Cacti if I just knew what to do.

I know what the problem is—my mental model of how this is supposed to
work doesn't match the mental model of the Cacti developers. And without
that clear mental model, the whole process under Cacti just doesn't make
sense to me.

I had the same problem with C when I first started using it. I had been
programming for years in Assembly, and there were certain cases
where a problem would have been trivial in Assembly but I was utterly lost
for a solution with C. Of course, over time, I gained the ability to
“think” in C, and now what was once problematic in C (but not in Assembly)
is now trivial in C.

But that took a few years though, and at least with C, the knowledge is
still useful. I'm doubting that the time I spend with Cacti will have the
same benefit over the long term.

And that's bugging me too, mainly because it seems like I'm
justifying not learning it at all.

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go
ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or
entry, if there is only one entry). The titles are the permanent
links to that entry only. The format for the links are
simple: Start with the base link for this site: http://boston.conman.org/, then add the date you are
interested in, say 2000/08/01,
so that would make the final URL:

You may also note subtle shading of the links and that's
intentional: the “closer” the link is (relative to the
page) the “brighter” it appears. It's an experiment in
using color shading to denote the distance a link is from here. If
you don't notice it, don't worry; it's not all that
important.

It is assumed that every brand name, slogan, corporate name,
symbol, design element, et cetera mentioned in these pages is a
protected and/or trademarked entity, the sole property of its
owner(s), and acknowledgement of this status is implied.