Munin, Monit, Webalizer need help!

Discussion in 'HOWTO-Related Questions' started by lordshadow, May 31, 2008.

  1. lordshadow

    lordshadow New Member

    Hi, I've read through the howto's on these programs but I'm having a bit of trouble with them:

    Munin gives me this error: Error writing to /var/run/munin/munin-update.lock, wrong permissions at /usr/share/perl5/Munin.pm line 356.

    Which I can't work out what is as it's not displaying any local or remote host graphs.

    I would also like to password Munin and Webalizer, however by trying the howto it didn't work. I'm not sure where the problem was.

    The last issue I have is Monit which gives me a page saying Index of /monit then a token file. But it isn't showing any graphs of systems processes

    I hope someone can help me - I am running Debian Etch

    Thanks
     
  2. Leszek

    Leszek New Member

    Does the directory which htmldir in /etc/munin/munin.conf points to belong to munin (user and group) and is writeable by him ?
    Any errors in Apache's logs? Is Your server/virtual host configured to read configuration from .htaccess files?
     
  3. lordshadow

    lordshadow New Member

    Thanks for the reply Leszek, I managed to get Munin sorted out and wokring as it was just a matter of sorting out permissions.

    As far as password is concerned for Webalizer, Munin and Monit not working I don't have any errors in my apache log. There was one but it wasn't to do with these; one for python and the other for perl which it said was sorted.
     
  4. Leszek

    Leszek New Member

    Do You have "AllowOverride All" directive in the configuration of Apache of a particular Virtual Host that doesn't accept .htaccess files ? I mean the <directory> </directory> part. For example:
    Code:
    [SIZE=2]<Directory /var/www/>[/SIZE][SIZE=2]        
            Options Indexes FollowSymLinks MultiViews
            Order allow,deny
            allow from all[/SIZE]
            [B][COLOR=Red]AllowOverride all[/COLOR][/B]
       [SIZE=2] </Directory>[/SIZE]
    
    Later You can decide if You need "AllowOverride all" or maybe something else.
     
  5. lordshadow

    lordshadow New Member

    Hi, sorry I forgot to mention that I'm not using virtual domains!

    Just standard /var/www dir with index.html in it
     
  6. Leszek

    Leszek New Member

    The same applies for global configuration.
    You'll have to look for something I mentioned earlier.
     
  7. lordshadow

    lordshadow New Member

    This is the current configuration in the sites-enabled dir:

    ServerAdmin root@localhost

    DocumentRoot /var/www/
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    </Directory>
    <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
    # This directive allows us to have apache2's default start page
    # in /apache2-default/, but still have / go to the right place
    #RedirectMatch ^/$ /apache2-default/
    </Directory>
     
  8. Leszek

    Leszek New Member

    Then change "AllowOverride None" to "AllowOverride All" so it looks like this:

    Code:
    ServerAdmin root@localhost
    
            DocumentRoot /var/www/
            <Directory />
                    Options FollowSymLinks
                    AllowOverride None
            </Directory>
            <Directory /var/www/>
                    Options Indexes FollowSymLinks MultiViews
                    [B][COLOR=Red]AllowOverride All[/COLOR][/B]
                    Order allow,deny
                    allow from all
                    # This directive allows us to have apache2's default start page
                    # in /apache2-default/, but still have / go to the right place
                    #RedirectMatch ^/$ /apache2-default/
            </Directory>
    
     
  9. lordshadow

    lordshadow New Member

    Sorry for the alte reply I got kinda caught up with work!

    Ok, I think I understand the problem; I followed the howto but it didn't work for me as creating a file called .htaccess and .htpasswd in the munin folder did nothing.

    I discovered this howto: http://www.debian-administration.org/articles/597 from Debian Admin which almost works for me now :)

    Just the problem is that when I enter the username and password now I get an error message saying: Forbidden - you do not have permission to access munin on this server.

    Can you suggest anything??
     
  10. Leszek

    Leszek New Member

    Maybe You should try to regenerate the password ?
    Maybe You've made a typo ?
    If You include:
    in Apache's configuration then You don't need the .htaccess file.
     
    Last edited: Jun 3, 2008
  11. lordshadow

    lordshadow New Member

    Hi, I've gone over the settings and I still get Forbidden message??

    Since the howto above claims that there is a cgi script involved:

    I had a look at my apache2.conf file which has cgi disabled.... I think (as I've never dealt with this before!)


    Code:
        #
        # AddHandler allows you to map certain file extensions to "handlers":
        # actions unrelated to filetype. These can be either built into the server
        # or added with the Action directive (see below)
        #
        # To use CGI scripts outside of ScriptAliased directories:
        # (You will also need to add "ExecCGI" to the "Options" directive.)
        #
        #AddHandler cgi-script .cgi
    
    
    Code:
    # Action lets you define media types that will execute a script whenever
    # a matching file is called. This eliminates the need for repeated URL
    # pathnames for oft-used CGI file processors.
    # Format: Action media/type /cgi-script/location
    # Format: Action handler-name /cgi-script/location
    

    Would enabling any of these help?

    This is also output of my error.log file from /var/log/apache2:

    Code:
    [Wed Jun 04 22:58:51 2008] [error] [client 192.168.1.40] Directory index forbidden by Options directive: /var/www/munin/
    
    What do you think the problem could be??
     
  12. falko

    falko Super Moderator ISPConfig Developer

    You can try to enable this line:
    Code:
    AddHandler cgi-script .cgi
    and restart Apache.
     
  13. lordshadow

    lordshadow New Member

    It didn't work :(

    I realy don't understand this as munin was working fine before I tried adding the password???

    The only changes I made actually, following the link posted above were:

    Code:
    htpasswd -c /etc/munin/munin.passwd munin
    
    nano /etc/apache2/sites-available/munin.conf
    
    Alias /munin /var/www/munin/
    
    <directory /var/www/munin/>
            AllowOverride None
            Options ExecCGI FollowSymlinks
            AddHandler cgi-script .cgi
            DirectoryIndex index.cgi
            AuthUserFile /etc/munin/munin.passwd
            AuthType basic
            AuthName "Munin stats"
            require valid-user
    </directory>
    
    a2ensite munin.conf
    
    Then restarted Apache
    Code:
    /etc/init.d/apache2 restart
    I just don't even know where to begin checking the problem!
     
    Last edited: Jun 5, 2008
  14. lordshadow

    lordshadow New Member

    Ok I've understood what's going on :) - Finally

    The URL used to resolve for mydomain.com/munin and automatically change to */munin/index.html

    however now it has stopped redirrecting so */munin is forbidden but */munin/index.html is fine?

    How can I get Apache to redirect again?
     
  15. falko

    falko Super Moderator ISPConfig Developer

    Add index.html to the DirectoryIndex line.
     
  16. lordshadow

    lordshadow New Member

    Thanks so much that worked!

    Is there a way to recover or add plugins like when munin first launches it autodetects alot of services? The reason I am asking is because the NTP plugin stopped functioning after my servers host name changed. I have deleted the file from /etc/ntp/plugins but I don't know how to add it again for it to work properly.

    Also is there a way to password Webalizer as I have googled but found nothing?
     
  17. falko

    falko Super Moderator ISPConfig Developer

    What's the output of
    Code:
    ls -la /etc/munin/plugins/
    ? What's in /etc/munin/plugin-conf.d/munin-node?

    You can do this with .htaccess. You can find an example how to do this here: http://www.howtoforge.com/server_monitoring_with_munin_monit_debian_etch (chapter 3).
     
  18. lordshadow

    lordshadow New Member

    Code:
    kayasaman@OptiplexGX270D:~$ ls -la /etc/munin/plugins/
    total 8
    drwxr-xr-x 2 root root 4096 2008-06-06 00:52 .
    drwxr-xr-x 5 root root 4096 2008-05-31 09:36 ..
    lrwxrwxrwx 1 root root   28 2008-05-31 09:36 cpu -> /usr/share/munin/plugins/cpulrwxrwxrwx 1 root root   27 2008-05-31 09:36 df -> /usr/share/munin/plugins/df
    lrwxrwxrwx 1 root root   33 2008-05-31 09:36 df_inode -> /usr/share/munin/plugins/df_inode
    lrwxrwxrwx 1 root root   32 2008-05-31 09:36 entropy -> /usr/share/munin/plugins/entropy
    lrwxrwxrwx 1 root root   39 2008-05-31 09:36 exim_mailqueue -> /usr/share/munin/plugins/exim_mailqueue
    lrwxrwxrwx 1 root root   39 2008-05-31 09:36 exim_mailstats -> /usr/share/munin/plugins/exim_mailstats
    lrwxrwxrwx 1 root root   30 2008-05-31 09:36 forks -> /usr/share/munin/plugins/forks
    lrwxrwxrwx 1 root root   28 2008-05-31 09:36 if_ath0 -> /usr/share/munin/plugins/if_
    lrwxrwxrwx 1 root root   32 2008-05-31 09:36 if_err_ath0 -> /usr/share/munin/plugins/if_err_
    lrwxrwxrwx 1 root root   32 2008-05-31 09:36 if_err_eth0 -> /usr/share/munin/plugins/if_err_
    lrwxrwxrwx 1 root root   28 2008-05-31 09:36 if_eth0 -> /usr/share/munin/plugins/if_
    lrwxrwxrwx 1 root root   35 2008-05-31 09:36 interrupts -> /usr/share/munin/plugins/interrupts
    lrwxrwxrwx 1 root root   31 2008-05-31 09:36 iostat -> /usr/share/munin/plugins/iostat
    lrwxrwxrwx 1 root root   33 2008-05-31 09:36 irqstats -> /usr/share/munin/plugins/irqstats
    lrwxrwxrwx 1 root root   29 2008-05-31 09:36 load -> /usr/share/munin/plugins/load
    lrwxrwxrwx 1 root root   31 2008-05-31 09:36 memory -> /usr/share/munin/plugins/memory
    lrwxrwxrwx 1 root root   32 2008-05-31 09:36 netstat -> /usr/share/munin/plugins/netstat
    lrwxrwxrwx 1 root root   35 2008-05-31 09:36 nfs_client -> /usr/share/munin/plugins/nfs_client
    lrwxrwxrwx 1 root root   35 2008-05-31 09:36 open_files -> /usr/share/munin/plugins/open_files
    lrwxrwxrwx 1 root root   36 2008-05-31 09:36 open_inodes -> /usr/share/munin/plugins/open_inodes
    lrwxrwxrwx 1 root root   34 2008-05-31 09:36 processes -> /usr/share/munin/plugins/processes
    lrwxrwxrwx 1 root root   29 2008-05-31 09:36 swap -> /usr/share/munin/plugins/swap
    lrwxrwxrwx 1 root root   31 2008-05-31 09:36 vmstat -> /usr/share/munin/plugins/vmstat
    

    Code:
    kayasaman@OptiplexGX270D:~$ cat /etc/munin/plugin-conf.d/munin-node
    # This file is used to configure how the plugins are invoked.
    #
    # user <user>         # Set the user to run the plugin as.
    # group <group>       # Set the group to run the plugin as.
    # command <command>   # Run <command> instead of the plugin. %c expands to
    #                       what would normally be run.
    # env.<variable>      # Sets <variable> in the plugin's environment, see the
    #                       individual plugins to find out which variables they
    #                       care about.
    
    [apt]
    user root
    
    [courier_mta_mailqueue]
    group daemon
    
    [courier_mta_mailstats]
    group adm
    
    [courier_mta_mailvolume]
    group adm
    
    [cps*]
    user root
    
    [exim_mailqueue]
    group mail, (Debian-exim)
    
    [exim_mailstats]
    group mail, adm
    
    [fw_conntrack]
    user root
    
    [hddtemp_smartctl]
    user root
    
    [if_*]
    user root
    
    [if_err_*]
    user nobody
    
    [ip_*]
    user root
    
    [mysql*]
    user root
    env.mysqlopts --defaults-extra-file=/etc/mysql/debian.cnf
    
    [postfix_mailqueue]
    user (postfix)
    
    [postfix_mailstats]
    group adm
    
    [postfix_mailvolume]
    group adm
    
    [smart_*]
    user root
    
    [vlan*]
    user root
    
    I never had any NTP section even from the start when the NTP file was in: /etc/munin/plugins/
    Somehow Munin managed to auto-generate the NTP part but then lost it due to a DNS change.



    Also I have been to the website given but my directory structure is slightly different from the howto which I think is what got me stuck when I attempted it the first time then switched and didn't use the .htpasswd and access for Munin.

    This is the directory tree for webalizer on my Debian Etch build:

    Code:
    kayasaman@OptiplexGX110:/var/www/webalizer$ ls
    ctry_usage_200804.png   hourly_usage_200804.png  usage_200806.html
    ctry_usage_200805.png   hourly_usage_200805.png  usage.png
    ctry_usage_200806.png   hourly_usage_200806.png  webalizer.current
    daily_usage_200804.png  index.html               webalizer.hist
    daily_usage_200805.png  usage_200804.html
    daily_usage_200806.png  usage_200805.html
    
    Would this mean that I would put the .htaccess and .htpasswd files in/var/ww/webalizer???
     
  19. falko

    falko Super Moderator ISPConfig Developer

    Put the .htaccess file in munin's output directory (I'm not sure if it is /var/www/webalizer on your system) and the .htpasswd file somewhere outside your document root, but make sure that you specify the correct path to it in .htaccess.
     
  20. lordshadow

    lordshadow New Member

    Sorry are we geting mixed up with topics here because I'm trying to solve 2 things at once!

    With the .htaccess and .htpasswd, I want that for webalizer not Munin as I've already got a username and password for Munin via a different method.

    For Munin I ask above for the NTP plugin and posted the result as requested.

    Sorry if there was a mix up :)
     

Share This Page