The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mailscannr-mrtg.conf

Discussion in 'cPanel Developers' started by Valuehosted, Apr 8, 2004.

  1. Valuehosted

    Valuehosted Well-Known Member

    Joined:
    Dec 12, 2002
    Messages:
    124
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Sweden
    Does anyone have mailscanner-mrtg working with a cpanel install? if so - could you post the conf file?

    I keep getting the following error every 5 min.. :) I just don't know what the correct settings should be.

    Unable to find a mountpoint for /var/spool. Please set Spool Directory in mailscanner-mrtg.conf to a valid mountpoint Unable to find a mountpoint for /var/spool/MailScanner/incoming. Please set MailScanner Work Directory in mailscanner-mrtg.conf to a valid mountpoint Cannot access log file /var/spool/exim/log/mainlog, No such file or directory
    Skipping processing of /var/spool/exim/log/mainlog

    --Tone
     
  2. nickn

    nickn Well-Known Member
    PartnerNOC

    Joined:
    Jun 15, 2003
    Messages:
    619
    Likes Received:
    1
    Trophy Points:
    18
    There's a lot of obvious errors in your mailscanner-mrtg setup.

    Paste your mailscanner-mrtg.conf here and I'll edit it and repost :)
     
  3. Valuehosted

    Valuehosted Well-Known Member

    Joined:
    Dec 12, 2002
    Messages:
    124
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Sweden
    i know its obvious - I just don't knwo what it is actually supposed to be there.

    ok - here goes.. i really appreciate your help!

    # $Id: mailscanner-mrtg.conf,v 1.20 2004/01/28 21:23:31 kevinspicer Exp $

    # ----------------
    # GENERAL SETTINGS
    # ----------------

    # Where to calculate bytes of Mail Transferred from
    # Either "MTA" or "MailScanner"
    # "MTA" is probably more acurate, and is the only value you can use if
    # you don't use MailScanner for virus scanning
    # "MailScanner" is probably less acurate and can only be used if you are
    # using MailScanner for virus scanning
    Calculate MailBytes = MTA

    # File which holds state information between runs
    #State File = ./state.info # This used for testing
    State File = /var/www/html/mailscanner-mrtg/state.info

    # WWW Root - the directory for html files
    # usually /var/www/html
    WWW Root = /var/www/html

    # ------------
    # MTA SETTINGS
    # ------------

    # Which MTA you are using, acceptable values are...
    # sendmail postfix exim
    MTA = sendmail

    # MTA Incoming Log: where incoming mail is logged by MTA
    #MTA Incoming Log = /var/log/mail/info # Mandrake with sendmail (& postfix?)
    #MTA Incoming Log = /var/spool/exim/log/mainlog # Red Hat with exim
    #MTA Incoming Log = /var/log/maillog # Red Hat with sendmail (& postfix?)
    MTA Incoming Log = /var/spool/exim_incoming/

    # MTA Outgoing Log: where outgoing mail is logged by MTA
    #MTA Outgoing Log = /var/log/mail/info # Mandrake with sendmail (& postfix?)
    #MTA Outgoing Log = /var/spool/exim/log/mainlog # Red Hat with exim
    #MTA Outgoing Log = /var/log/maillog # Red Hat with sendmail (& postfix?)
    MTA Outgoing Log = /var/spool/exim/msglog/

    # MTA Reject Log: where rejected mail is logged by MTA (spam)
    # NB. This is mainly for exim users. If you don't have a seperate
    # reject log you should set this to be the same as MTA Incoming Log
    #MTA Reject Log = /var/log/mail/info # Mandrake with sendmail (& postfix?)
    MTA Reject Log = /var/spool/exim/log/mainlog # Red Hat with exim
    #MTA Reject Log = /var/log/maillog # Red Hat with sendmail (& postfix?)

    # Where the MTA puts mail before MailScanner gets it
    #Incoming Queue Dir = /var/spool/postfix.in/deferred/ # Postfix
    Incoming Queue Dir = /var/spool/exim_incoming/input/ # Exim
    #Incoming Queue Dir = /var/spool/mqueue.in/ # Sendmail


    # --------------------
    # MAILSCANNER SETTINGS
    # --------------------

    # We can restart MailScanner if the number of MailScanner processes
    # goes below this number. Change to 0 if you don't want us to restart.
    Restart Threshhold = 1

    # The script to run to restart MailScanner
    Restart MailScanner = /etc/rc.d/init.d/MailScanner restart

    # This is where your logged spam and virii goes. You MUST have
    # "Log Spam = yes" in your MailScanner.conf file for us to graph spam.
    #MailScanner Log = /var/log/mail/info # Mandrake
    MailScanner Log = /var/log/maillog # Red Hat


    # Where MailScanner puts your mail after it is scanned
    #Outgoing Queue Dir = /var/spool/postfix/incoming/ # Postfix
    Outgoing Queue Dir = /var/spool/exim/input # Exim (?)
    #Outgoing Queue Dir = /var/spool/mqueue/ # Sendmail

    # The MailScanner work directory, often in tmpfs for those who are worried
    # about performance. Usually /var/spool/MailScanner/incoming.
    # If this is not set to a mount point the graph will be blank
    MailScanner Work Directory = /var/spool/MailScanner/incoming

    # The spool directory
    # If this is not set to a mount point the graph will be blank
    Spool Directory = /var/spool

    # The MailScanner quarantine directory
    Quarantine Directory = /var/spool/MailScanner/quarantine


    # -----------------
    # EXTERNAL COMMANDS
    # -----------------

    # If your uptime is not reported correctly on your MRTG graphs then
    # put the output of "which uptime" here.
    Uptime Command = /usr/bin/uptime


    # -------------
    # SNMP SETTINGS
    # -------------

    # Set this to no if you do not want to use snmp - note that this will result
    # in several graphs being blank.
    # You must use either net-snmp or ucd-snmp, this is auto-detected
    Use SNMP = no

    # The UDP port that snmp listens on. This is usually port 161.
    SNMP port = 161

    # The Community string to use (this should be a read-only community)
    SNMP Community = public

    # where is your snmpwalk command?
    Snmpwalk Binary = /usr/bin/snmpwalk

    # Which interfaces to monitor (comma separated list)
    Interfaces to Monitor = eth0

    # --------------
    # RATIO SETTINGS
    # --------------

    # If you want the virus ratio and spam ratio graphs to show the ratios
    # so-far-today set the following to yes. Otherwise the ratios will be
    # calculated over the previous five minutes only
    Ratios are Daily = no

    # Some people don't like getting 100% spam or virus on their graphs becuase
    # only a few mails have been processed - this is especially true when Ratios
    # Are Daily = yes, as there will probably be an initial bump in the middle of
    # night when the graphs roll over.
    # The following setting allows you to specify a minimum number of mails that
    # be received before ratios are recorded.
    # NB I don't like this (which is why the default is 0), I'd rather have an
    # accurate but ugly graph and understand how to interpret it properly - but if
    # folks want it here it is...
    Skip Ratios Below = 0
     
  4. nickn

    nickn Well-Known Member
    PartnerNOC

    Joined:
    Jun 15, 2003
    Messages:
    619
    Likes Received:
    1
    Trophy Points:
    18
    # $Id: mailscanner-mrtg.conf,v 1.20 2004/01/28 21:23:31 kevinspicer Exp $

    # ----------------
    # GENERAL SETTINGS
    # ----------------

    # Where to calculate bytes of Mail Transferred from
    # Either "MTA" or "MailScanner"
    # "MTA" is probably more acurate, and is the only value you can use if
    # you don't use MailScanner for virus scanning
    # "MailScanner" is probably less acurate and can only be used if you are
    # using MailScanner for virus scanning
    Calculate MailBytes = MTA

    # File which holds state information between runs
    #State File = ./state.info # This used for testing
    State File = /var/www/html/mailscanner-mrtg/state.info

    # WWW Root - the directory for html files
    # usually /var/www/html
    WWW Root = /var/www/html

    # ------------
    # MTA SETTINGS
    # ------------

    # Which MTA you are using, acceptable values are...
    # sendmail postfix exim
    MTA = sendmail

    # MTA Incoming Log: where incoming mail is logged by MTA
    #MTA Incoming Log = /var/log/mail/info # Mandrake with sendmail (& postfix?)
    #MTA Incoming Log = /var/spool/exim/log/mainlog # Red Hat with exim
    #MTA Incoming Log = /var/log/maillog # Red Hat with sendmail (& postfix?)
    MTA Incoming Log = /var/logs/exim_mainlog

    # MTA Outgoing Log: where outgoing mail is logged by MTA
    #MTA Outgoing Log = /var/log/mail/info # Mandrake with sendmail (& postfix?)
    #MTA Outgoing Log = /var/spool/exim/log/mainlog # Red Hat with exim
    #MTA Outgoing Log = /var/log/maillog # Red Hat with sendmail (& postfix?)
    MTA Outgoing Log = /var/logs/exim_mainlog

    # MTA Reject Log: where rejected mail is logged by MTA (spam)
    # NB. This is mainly for exim users. If you don't have a seperate
    # reject log you should set this to be the same as MTA Incoming Log
    #MTA Reject Log = /var/log/mail/info # Mandrake with sendmail (& postfix?)
    MTA Reject Log = /var/spool/exim/log/mainlog # Red Hat with exim
    #MTA Reject Log = /var/log/maillog # Red Hat with sendmail (& postfix?)

    # Where the MTA puts mail before MailScanner gets it
    #Incoming Queue Dir = /var/spool/postfix.in/deferred/ # Postfix
    Incoming Queue Dir = /var/spool/exim_incoming/input/ # Exim
    #Incoming Queue Dir = /var/spool/mqueue.in/ # Sendmail


    # --------------------
    # MAILSCANNER SETTINGS
    # --------------------

    # We can restart MailScanner if the number of MailScanner processes
    # goes below this number. Change to 0 if you don't want us to restart.
    Restart Threshhold = 1

    # The script to run to restart MailScanner
    Restart MailScanner = /etc/rc.d/init.d/MailScanner restart

    # This is where your logged spam and virii goes. You MUST have
    # "Log Spam = yes" in your MailScanner.conf file for us to graph spam.
    #MailScanner Log = /var/log/mail/info # Mandrake
    MailScanner Log = /var/log/maillog # Red Hat


    # Where MailScanner puts your mail after it is scanned
    #Outgoing Queue Dir = /var/spool/postfix/incoming/ # Postfix
    Outgoing Queue Dir = /var/spool/exim/input # Exim (?)
    #Outgoing Queue Dir = /var/spool/mqueue/ # Sendmail

    # The MailScanner work directory, often in tmpfs for those who are worried
    # about performance. Usually /var/spool/MailScanner/incoming.
    # If this is not set to a mount point the graph will be blank
    MailScanner Work Directory = /var/spool/MailScanner/incoming

    # The spool directory
    # If this is not set to a mount point the graph will be blank
    Spool Directory = /var/

    # The MailScanner quarantine directory
    Quarantine Directory = /var/spool/MailScanner/quarantine


    # -----------------
    # EXTERNAL COMMANDS
    # -----------------

    # If your uptime is not reported correctly on your MRTG graphs then
    # put the output of "which uptime" here.
    Uptime Command = /usr/bin/uptime


    # -------------
    # SNMP SETTINGS
    # -------------

    # Set this to no if you do not want to use snmp - note that this will result
    # in several graphs being blank.
    # You must use either net-snmp or ucd-snmp, this is auto-detected
    Use SNMP = no

    # The UDP port that snmp listens on. This is usually port 161.
    SNMP port = 161

    # The Community string to use (this should be a read-only community)
    SNMP Community = public

    # where is your snmpwalk command?
    Snmpwalk Binary = /usr/bin/snmpwalk

    # Which interfaces to monitor (comma separated list)
    Interfaces to Monitor = eth0

    # --------------
    # RATIO SETTINGS
    # --------------

    # If you want the virus ratio and spam ratio graphs to show the ratios
    # so-far-today set the following to yes. Otherwise the ratios will be
    # calculated over the previous five minutes only
    Ratios are Daily = no

    # Some people don't like getting 100% spam or virus on their graphs becuase
    # only a few mails have been processed - this is especially true when Ratios
    # Are Daily = yes, as there will probably be an initial bump in the middle of
    # night when the graphs roll over.
    # The following setting allows you to specify a minimum number of mails that
    # be received before ratios are recorded.
    # NB I don't like this (which is why the default is 0), I'd rather have an
    # accurate but ugly graph and understand how to interpret it properly - but if
    # folks want it here it is...
    Skip Ratios Below = 0
     
  5. nickn

    nickn Well-Known Member
    PartnerNOC

    Joined:
    Jun 15, 2003
    Messages:
    619
    Likes Received:
    1
    Trophy Points:
    18
    I fixed three things, however I think there is probably a few more I missed, I don't currently have time to check those though.

    Open up your mailscanner conf file in cPanel, compare the locations of the different queues, and logs.
     
  6. bking

    bking Well-Known Member

    Joined:
    Mar 1, 2004
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Sydney
    In addition to the above, the error for the spool mountpoint is probably because your spool directory does not have its own mount point?
    I had the same error, and I dont have a seperate partition for /var/spool
    I commented this section out of the /etc/mrtg/mailscanner-mrtg.cfg file.
    Ran the script a couple of times and there has been no complaints thus far...
     

Share This Page