Enable PNP graphs on mouseover

1,056 views
Skip to first unread message

Thomas Wittmann

unread,
Jul 4, 2016, 9:38:43 AM7/4/16
to synagios-users
Since i use Nagios/Icinga/Check_MK for several years now i missed a comfort feature:
Having the PNP4nagios graphs on mouseover.
I did a little research:
- the action URLs already are OK: 
  - /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
  - /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_

So i had a look and found out that the file status-header.ssi is missing.
So here we go:
1. chroot /volume1/@appstore/Synagios/nagios-chroot/ /bin/bash
2. cd /usr/share/nagios3/htdocs
3. vi status-header.ssi
     <script src="/pnp4nagios/media/js/jquery-min.js" type="text/javascript"></script>
     <script src="/pnp4nagios/media/js/jquery.cluetip.js" type="text/javascript"></script>
     <script type="text/javascript">
     jQuery.noConflict();
     jQuery(document).ready(function() {
       jQuery('a.tips').cluetip({ajaxCache: false, dropShadow: false,showTitle: false });
     });
     </script>
5. chown www-data:www-data status-header.ssi
6. chmod 644 status-header.ssi
7. service apache2 restart

Now reload the page and voila, as soon as you hove over the action url icon, you can see the 4h-pnp graph of the corresponding host/service


 

Mark Clarkson

unread,
Jul 4, 2016, 10:10:14 AM7/4/16
to synagios-users
Aha, thanks! I just enabled this handy shortcut for users at work (Nagios on Centos though). I'm going to try it on my diskstation this week too and reply back here.

Thomas Wittmann

unread,
Jul 4, 2016, 4:18:14 PM7/4/16
to synagios-users
You're welcome :)

Mark Clarkson

unread,
Jul 4, 2016, 5:05:08 PM7/4/16
to synagios-users
On Monday, 4 July 2016 14:38:43 UTC+1, Thomas Wittmann wrote:
1. chroot /volume1/@appstore/Synagios/nagios-chroot/ /bin/bash
2. cd /usr/share/nagios3/htdocs
3. vi status-header.ssi
     <script src="/pnp4nagios/media/js/jquery-min.js" type="text/javascript"></script>
     <script src="/pnp4nagios/media/js/jquery.cluetip.js" type="text/javascript"></script>
     <script type="text/javascript">
     jQuery.noConflict();
     jQuery(document).ready(function() {
       jQuery('a.tips').cluetip({ajaxCache: false, dropShadow: false,showTitle: false });
     });
     </script>
5. chown www-data:www-data status-header.ssi
6. chmod 644 status-header.ssi
7. service apache2 restart


Hi Thomas,
Almost perfect! The only change I had to do was:

change:
  3. vi status-header.ssi
to:
  3. vi ssi/status-header.ssi

I pasted the ssi script from your post verbatim, with the extra spaces at the start of the lines, and it still worked.

So now I have lovely graph pop-ups.

Thanks!
Mark

Thomas Wittmann

unread,
Jul 5, 2016, 7:17:58 AM7/5/16
to synagios-users
Ah yeah i see, i forgot the ssi subfolder, i think the extra space is a copy-and-paste accident :)
Thanks for the feedback :)

Tom
Reply all
Reply to author
Forward
0 new messages