Integrate munin into ISPConfig3

Discussion in 'Installation/Configuration' started by osterhase, Jan 8, 2012.

  1. osterhase

    osterhase New Member

    Hi there,

    I'm running munin to mointor some servers. I would like to integrate munin into ispconfig. I would like to add a Link in "Tools". After clicking this link the munin-page should be shown within the ispconfig-frame.

    Is this possible and how can this be achieved? I would appreciate any help.

    Best regards
    osterhase
     
  2. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    Add a file in the menu directory /usr/local/ispconfig/interface/web/tools/lib/menu.d/

    Example:

    create a new file like google.menu.php with this content:

    Code:
    <?php
    
    
    // Menu
    
    if($app->auth->is_admin()) {
    
    $items = array();
    
    $items[] = array( 'title' 	=> 'Google',
    				  'target' 	=> 'content',
    				  'link'	=> 'http://www.google.com');
    
    
    $module['nav'][] = array(	'title'	=> 'Import',
    							'open' 	=> 1,
    							'items'	=> $items);
    
    unset($items);
    }
    
    ?>
     
  3. osterhase

    osterhase New Member

    Thanks Till - that was what I was looking for.

    From there I decided to integrate Munin into the "Monitoring" tab which seems to fit better for a Server-Monitoring-Tool. So the path would be rather "/usr/local/ispconfig/interface/web/monitor/lib/module.conf.php".

    There I had the option to integrate the main Munin-Page under the menu-point "All Servers" or to kick the user directly to the selected server:

    Code:
    /*
     * Clear and set the Navigation-Items
     */
    unset($items);
    
    $items[] = array( 'title' 	=> "Show CPU info",
            'target' 	=> 'content',
            'link'	=> 'monitor/show_data.php?type=cpu_info',
            'html_id' => 'cpu_info');
    
    /* Munin added admin_nw */				  
    $items[] = array( 'title' 	=> 'Munin',
    				  'target' 	=> 'content',
    				  'link'	=> '/munin/example.com/' [B].$_SESSION['monitor']['server_name'].[/B] '/index.html');
    /* End admin_nw */		
    		
    $module["nav"][] = array(	'title'	=> 'Hardware-Information',
            'open' 	=> 1,
            'items'	=> $items);
    
    /*
    The bold part of the code is my try to let the user select the server and then come directly to the server. Obviously I'm just running into the first server of the array. Is there an easy way to adapt changes in the Dropdown-Menu to the link?

    I'm not quite sure if the next question is in the right spot: Due to the fact that munin is working with relative paths no graphs are shown in the content-view of ispconfig because they try to be loaded from the ispconfig-Panel Domain which won't work. I have a couple of ideas to solve this but all of them are connected with a lot of hard coding. Any suggestions what the best way would be to fix this?

    Best regards
    osterhase
     
  4. osterhase

    osterhase New Member

    ...ok. Too stupid question.

    So I'm asking for a workaround. Is it possible to open the content in a new tab like "_blank"?

    I'm thankful for your help.
     
: munin

Share This Page