ecription c2n.cgi is a filter/wrapper for the frontend of Cacti to include it in Nagios. It includes the Cacti interface in the right frame of the Nagios web interface. It filters out any possiblity to switch from one host to another using cacti menus. Therefore the authentication system of Nagios will take place and the authentication system of Cacti is unused. Features c2n.cgi can handle multiple installations of Cacti with seperate databases. Prerequisites: - guest account in cacti must be enabled - CGI.pm - libwww-perl - a database user how is able to read all tables in the Cacti database - The name of a host in Nagios must be the same as in the description in Cacti because the two are used to join the information from both systems Installation It is easy. Place c2n.cgi in a valid CGI directory. I used the nagios cgi directory. Enable the guest account in your Cacti. It would be good if you hide your cacti. This can be done by using a non public servername (or something like that) or setting up your webserver as a reverse proxy (httpd.conf): .... LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_connect_module modules/mod_proxy_connect.so ..... # Setting for reverse proxy - M.Fuerstenau - 20.9.2008 #ProxyVia On ProxyVia On # Start settings for reverse proxy - M.Fuerstenau # Reverse proxy was needed for Cacti and for some administrative websites # because these servers are not reachable from the client network ProxyPass /ci0/ http://server1/ ProxyPassReverse /ci0/ http://server1/ ProxyPass /ci1/ http://server2/ ProxyPassReverse /ci1/ http://server2/ # End settings for reverse proxy - M.Fuerstenau .... The benefit of using a reverse proxy is that you can use a cacti instance on a server behind a firewall or whereever. It is extremely usefull if the users of the Nagios web frontend are not allowed to connect to that Cacti instance due to security regulations. In my case I can reach a lot of servers from my Nagios machine only via a firewall. Therefore a central NRPE server is running behind the firewall doing the checks. And now I placed a second Cacti on that server too. It is possible to make a proxy entry for the local server too. So you can hide a cacti running on the machine like your Nagios. What to configure in c2n.cgi? Not much: $CACTI_URI=cacti where cacti is the URI defined in global.php. Beware: NO trailing or ending / %URL_PART1 = ( 0 => "$CALLING_SERVER/ci0", 1 => "$CALLING_SERVER/ci1" ); %DBHOST = ( 0 => "mysqlsrv", 1 => "cacti_probe" ); %DBLOGIN = ( 0 => "stat4nag", 1 => "stat4nag" ); %DBPASS = ( 0 => "stat", 1 => "stat" ); %DATABASE = ( 0 => "cacti", 1 => "cacti" ); %DBPORT = ( 0 => "3306", 1 => "3306" ); %URL_PART1 makes the mappings for the reverse proxy. The rest is clear. Configuration in Nagios In every hostdefinition place a line like that: action_url c2n.cgi?host=$HOSTNAME$&nagios=1&cacti_instance=0 where nagios=1 means the first filter block in the script and cacti_instance=0 means the cacti instance where the index 0 in %URL_PART1 points to. You can also use notes_url instead of action_url. In cgi.cfg set # URL TARGET FRAMES # These options determine the target frames in which notes and # action URLs will open. #action_url_target=_blank #notes_url_target=_blank action_url_target=main notes_url_target=main Set action_url_target or notes_url_target (whatever you prefer) to main. Otherwise a new browser is opened. In case of trouble feel free to contact me.