Postfix monitoring with David Schweikert's Mailgraph?

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
aboyz

good work!!

Post by aboyz »

excellent work on the install readme also!! this explain it more on how everything is operated!!! :) I'll try this on one of my postfix box and see how it runs..

:)

thank you all for the good addon..
aboyz

I don't see /usr/local/bin/allstat.sh?

Post by aboyz »

Hi,

In the code.. where you add in the. cat append_to_snmpd.conf.txt >> /usr/local/share/snmp/snmpd.conf

exec mailcount /usr/local/bin/allstat.sh

I don't see a file called allstat.sh? did you forgot to upload it?

thanks
aboyz

I'm getting error when running mailgraph.pl

Post by aboyz »

This is what I get when I run mailgraph.pl

mail08# ./mailgraph.sh start
Starting mailgraph.
mesg: /dev/ttyp0: Operation not permitted
Global symbol "$counttype" requires explicit package name at /usr/local/sbin/mailgraph.pl line 696.
Global symbol "$counttype" requires explicit package name at /usr/local/sbin/mailgraph.pl line 697.
Global symbol "$counttype" requires explicit package name at /usr/local/sbin/mailgraph.pl line 698.
Global symbol "$counttype" requires explicit package name at /usr/local/sbin/mailgraph.pl line 700.
Execution of /usr/local/sbin/mailgraph.pl aborted due to compilation errors.

This is what is on my mailgraph.pl line 696-700
open (CTF, "+< " . $file_path . $counttype) or next; # Skip if file isn't there
$sum{$counttype} += <CTF>; # Read & Add
seek (CTF, 0, 0); # Rewind file
print CTF $sum{$counttype} . "\n"; # Write new info


. Anyone know what is wrong? I'm running
freebsd 4.11
net-snmp 5.2.1
mailgraph 1.10

I follow the instruction as it is. i copy the mailgraph.pl that came with the zip file and replaced it on mailgraph.pl

Anyone know what that error mean? and how do i fix it

thanks
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

This is probably a perl issue... What version of Perl are you using? (Try perl -v at a prompt) I'm using 5.8.0
Global symbol "$counttype" requires explicit package name at /usr/local/sbin/mailgraph.pl line 696.
That usually doesn't happen for loop variables, but you can try changing line 695 to:

Code: Select all

foreach my $counttype (keys(%sum)) {
(Note the added "my" in there...)

Or you could add a line that says:

Code: Select all

my $counttype;
Directly above the foreach line.

Let me know if that helps.

aboyz

Ok.

Post by aboyz »

yeah that fixed it

I was using a older version of perl. 5.6.1

What about this file I don't have it. its the append file to be added in snmpd.sh I can't find anywhere on my system the allstat.sh
exec mailcount /usr/local/bin/allstat.sh

after starting snmpd.sh i get this

mail08# ./snmpd.sh restart
Stopping snmpd.
Waiting for PIDS: 12257.
exec: mailcount: not found
Starting snmpd.
exec: mailcount: not found
exec: mailcount: not found
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

Whoops... forgot to change that in the file in the zip. That should be "postfixstats.sh" not "allstats.sh"
aboyz

Hi,

Post by aboyz »

Hi,

I'm still getting.

mail08# ./snmpd.sh start
Starting snmpd.
exec: mailcount: not found

i checked and everythign is in the correct path.

any ideas??

Oh, it made be a chmod premission? should i chmod it to 555 or 755?
aboyz

can i see what you got in your snmpd.conf

Post by aboyz »

Hi,

can I see what you got in your snmpd.conf.

thank you for all the help..
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

Yeah, the .sh and .pl scripts should be chmod'd to be executable.

I uploaded a new version of the mailgraph-jjp.zip file to my original posting with updated instructions and a couple minor changes.
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

The only special contents of my snmpd.conf file are the one line from the text file in the zip:

Code: Select all

exec   mailcount                /usr/local/bin/postfixstats.sh
aboyz

why does it give me error.

Post by aboyz »

I try to run that scripts from

/usr/local/bin/postfixstats.sh

and it return this.

mail08# ./postfixstats.sh
sent:0 received:0 rejected:0 bounced:0 spam:0 virus:0

What can be wrong?
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

Either mailgraph hasn't updated the files properly, or it hasn't passed any mail :)

I'll check back tomorrow...
aboyz

thanks

Post by aboyz »

I think i know what the problems is..

mesg: /dev/ttyp0: Operation not permitted

when i start mailgraph

thats properly why its not starting :)

thank you!! i'll update you tommorrow!!
aboyz

can someone help me.

Post by aboyz »

Hi,

I'm still getting
mesg: /dev/ttyp0: Operation not permitted
when i run ./mailgraph.sh

anyone know what this mean? why it say operation not permitted?
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

Are you running mailgraph as root?
Usually you'll get errors if it's not being run as root.

Try running this before running it again:

Code: Select all

mesg y
Check the permissions of /var/log/maillog

Code: Select all

-rw-r-----  1 root  wheel  64638461 May 17 14:26 /var/log/maillog
And check the permissions of /dev/ttyp0

Code: Select all

crw--w----  1 <your username>  tty    5,   0 May 17 14:28 /dev/ttyp0
You might also try not starting the script as ./mailgraph.sh, but start it like so:

Code: Select all

/usr/local/etc/rc.d/mailgraph.sh start
You can also check /var/log/messages to see if there are any other errors.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests