Munin and Monit on ISPConfig 3, Debian 7, nginx

Discussion in 'ISPConfig 3 Priority Support' started by inside83, Mar 3, 2015.

  1. inside83

    inside83 Member HowtoForge Supporter

    Hello!

    I just installed munin on Debian 7 with ISPConfig 3 (nginx) following this tutorial: https://www.howtoforge.com/server-monitoring-with-munin-and-monit-on-debian-wheezy
    I added this under nginx directives on one of the sites (mydomain.com):
    Code:
    location /munin {
                           alias /var/cache/munin/www;
                           auth_basic "Restricted";
    auth_basic_user_file /var/cache/munin/.htpasswd;
                           location ~* ^/munin/(.+\.(jpg|jpeg|gif|css|png|js|ico|xml|txt))$ {
                                    alias /var/cache/munin/www/$1;
                           }
                    }
    Now, I have access to munin but only through mydomain.com/munin not through myISPConfighostname.com/munin.
    Is it possible to have myISPConfighostname.com/munin ?
    And why does it still says:
    Code:
    ERROR
    
    No Munin URL defined. 
    on Monitor tab > Show Munin ?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Sure, but nginx has no global aliases, so you will have to add the above nginx directived to every website were you want to access munin from.
    you did not define the munin URL under System > Interface config.
     
  3. inside83

    inside83 Member HowtoForge Supporter

    No, I missed that.
    What is the correct syntax?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    It is a normal url, like the ones that you enter in the url field of your web browser.
     
  5. inside83

    inside83 Member HowtoForge Supporter

    I have created new site as a subdomain of the main site and added this in nginx directives:
    Code:
    location /munin {
                           alias /var/cache/munin/www;
                           auth_basic "Restricted";
    auth_basic_user_file /var/cache/munin/.htpasswd;
                           location ~* ^/munin/(.+\.(jpg|jpeg|gif|css|png|js|ico|xml|txt))$ {
                                    alias /var/cache/munin/www/$1;
                           }
                    }
    So I am able to access munin with munin.domain.com/munin (could not get it to work with just munin.domain.com).
    No matter what I put in System > Server Config > Munin URL, munin.domain.com/munin or munin.domain.com/munin/index.html
    I get blank page / empty space when I go to Monitor > Show Munin
    2015-03-12 08_16_37-ISPConfig 3.0.5.4p5.png
    Further investigation led me to this:
    /var/www/clients/client1/web7/log/error.log is full of errors like this:
    Code:
    2015/03/12 08:10:22 [error] 15720#0: *1783 open() "/var/www/munin.domain.com/web/adpb/registration" failed (2: No such file or directory), client: 192.168.1.2, server: munin.domain.com, request: "GET /adpb/registration?username=user1&domain=WINDOWS_DOMAIN&hostname=PC1&action=login HTTP/1.1", host: "my.IP.add.ress"
    2015/03/12 08:10:41 [error] 15720#0: *1792 open() "/var/www/munin.domain.com/web/adpb/registration" failed (2: No such file or directory), client: 192.168.1.2, server: munin.domain.com, request: "GET /adpb/registration?username=user2&domain=WINDOWS_DOMAIN&hostname=PC2&action=login HTTP/1.1", host: "my.IP.add.ress"
    2015/03/12 08:10:49 [error] 15720#0: *1795 open() "/var/www/munin.domain.com/web/adpb/registration" failed (2: No such file or directory), client: 192.168.1.2, server: munin.domain.com, request: "GET /adpb/registration?username=user3&domain=WINDOWS_DOMAIN&hostname=PC3&action=login HTTP/1.1", host: "my.IP.add.ress"
    2015/03/12 08:11:26 [error] 15720#0: *1811 open() "/var/www/munin.domain.com/web/adpb/registration" failed (2: No such file or directory), client: 192.168.1.2, server: munin.domain.com, request: "GET /adpb/registration?username=user4&domain=WINDOWS_DOMAIN&hostname=PC4&action=login HTTP/1.1", host: "my.IP.add.ress"
    2015/03/12 08:11:32 [error] 15720#0: *1813 open() "/var/www/munin.domain.com/web/adpb/registration" failed (2: No such file or directory), client: 192.168.1.2, server: munin.domain.com, request: "GET /adpb/registration?username=user5&domain=WINDOWS_DOMAIN&hostname=PC5&action=login HTTP/1.1", host: "my.IP.add.ress"
    2015/03/12 08:11:39 [error] 15720#0: *1823 open() "/var/www/munin.domain.com/web/adpb/registration" failed (2: No such file or directory), client: 192.168.1.2, server: munin.domain.com, request: "GET /adpb/registration?username=user6&domain=WINDOWS_DOMAIN&hostname=PC6&action=login HTTP/1.1", host: "my.IP.add.ress"
    2015/03/12 08:11:47 [error] 15720#0: *1826 open() "/var/www/munin.domain.com/web/adpb/registration" failed (2: No such file or directory), client: 192.168.1.2, server: munin.domain.com, request: "GET /adpb/registration?username=user7&domain=WINDOWS_DOMAIN&hostname=PC7&action=login HTTP/1.1", host: "my.IP.add.ress"
    
    Also, is there a tutorial on how to configure monit with ISPConfig 3 and nginx?
    Tutorial here: https://www.howtoforge.com/server-monitoring-with-munin-and-monit-on-debian-wheezy-p2
    mentions only apache configuration.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    This happens due to your web browser blocking the munin url as it is from a different domain, so that not directly related to your munin install or ispconfig. To circumvent that, create a new symlink:

    ln -s /var/cache/munin/www /usr/local/ispconfig/interface/web/munin

    and then use https://serverhostname.tld:8080/munin as url in ispconfig. serverhostname.tld is the hostname that you use to access ispconfig.

    These errrs are not related to munin, you can see that in the paths of the errors, the path is not the munin path and not the path of the munin alias.
     
  7. inside83

    inside83 Member HowtoForge Supporter

    Ok, I'll check and get back to you.
    What about monit+nginx?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Monit runs its own http server on a different port anyway, so it does not interact with nginx at all.
     

Share This Page