My goal is to include HTML buttons in the Index page in order to classify my MRTG page in different subcategories. Right now what I have done is to make 6 empty graphs with a .png created by myself and it works fine. The only problem is that now I want to add more pages and I would want to have smaller buttons because I use 3 columns and they have the same size as a graph.

I have also tried by modifying the index.html file but everytime I want to add a graph I have to run the indexmaker so I run:

/usr/bin/indexmaker --output=/var/www/mrtg/index.html --title='MRTG Test'
--columns=3 /etc/mrtg/cfg/mrtg.cfg

Does anyone know how to do this please?

Thank you very much.


I finally found how to do it. I just have to create a HTML page and at the top I place an hoverable dropdown menu (dropdown menu that appears when the user moves the mouse over an element) and then with iframe I include the index.html MRTG page.

Here is how to create the hoverable dropdown menu:


In order to include with iframe the index.html page:

            <iframe id="form-iframe" src="index.html" style="margin:0; width:100%; height:150px; border:none; overflow:hidden;" scrolling="no" frameborder="0" onload="AdjustIframeHeightOnLoad()">
            <script type="text/javascript">
                    function AdjustIframeHeightOnLoad() { document.getElementById("form-iframe").style.height = document.getElementById("form-iframe").contentWindow.document.body.scrollHeight + "px"; }
                    function AdjustIframeHeight(i) { document.getElementById("form-iframe").style.height = parseInt(i) + "px"; }

The javascript part is for autoadjusting the content to the page size.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.