PDA

View Full Version : What about Traffic Maps ?


dobebo
16th August 2005, 17:47
How do I get those traffic Maps working
I made a little test Traffic Map with following parameters
Name * test
Width 100
Height 100
Background image (.png) I choose none
Key X pos 0
Key Y pos 0

After Adding this I get
File ./include/trafficMap/png/trafficMap2.png is not accessible

Any help you can give me ? What did I wrong ?

Again thank you
dobebo

wistof
16th August 2005, 17:58
you need to create 'check_graph_traffic', and next, create add hosts and relations hosts in traffic map...

Lap
18th August 2005, 15:15
Someone find a solution on the french forum.... sorry... :wink:
Look at:
http://www.oreon.org/Forum/ftopic741-contrib_inclusion_de_nagios_dans_oreon.html

If you don't speak french, i will try to translate.

Lap
18th August 2005, 16:32
If i have well understood their conversation:

First of all, you have to create in the root directory of Oreon a file containing:

<?
if (!isset($oreon))
exit();

$options = substr($_SERVER['REQUEST_URI'],strpos($_SERVER['REQUEST_URI'],"p=309"));

$page=$_GET['page'];

$url = "http://127.0.0.1/nagios/cgi-bin/".$page.".cgi?".$options;
$cgi = file_get_contents($url); //to get the cgi


if($page=="trends" || $page=="statusmap") //to get the javascript's fonctions
{
$javascript = substr($cgi,strpos($cgi,"<SCRIPT"),strpos($cgi,"</head>")-strpos($cgi,"<SCRIPT"));
$cgi = substr($cgi,strpos($cgi,"<table border=0")); //to suppress the header
$cgi = $javascript.$cgi; //to add the javascripts' functions
}
else
$cgi = substr($cgi,strpos($cgi,"<table")); //to suppress the header

$cgi = substr($cgi,0,strpos($cgi,"</body>")); //to suppress the end

$cgi = '<LINK REL="stylesheet" TYPE="text/css" HREF="/nagios/stylesheets/'.$page.'.css"><td valign="top" align="center">'.$cgi;

//link's modifications
$cgi = str_replace("status.cgi?","oreon.php?page=status&p=309&",$cgi);
$cgi = str_replace("extinfo.cgi?","oreon.php?page=extinfo&p=309&",$cgi);
$cgi = str_replace("history.cgi?","oreon.php?page=history&p=309&",$cgi);
$cgi = str_replace("avail.cgi?","oreon.php?page=avail&p=309&",$cgi);
$cgi = str_replace("notifications.cgi?","oreon.php?page=notifications&p=309&",$cgi);

$cgi = str_replace("cmd.cgi?","oreon.php?page=cmd&p=309&",$cgi);
$cgi = str_replace("action='cmd.cgi","action='/nagios/cgi-bin/cmd.cgi",$cgi);

$cgi = str_replace("href='trends.cgi?","href='oreon.php?page=trends&p=309&",$cgi);
$cgi = str_replace("HREF='trends.cgi?","href='oreon.php?page=trends&p=309&",$cgi);
$cgi = str_replace("SRC='trends.cgi?","src='/nagios/cgi-bin/trends.cgi?",$cgi);
$cgi = str_replace("src='trends.cgi?","src='/nagios/cgi-bin/trends.cgi?",$cgi);
$cgi = str_replace('action="trends.cgi','action="/nagios/cgi-bin/trends.cgi',$cgi);

$cgi = str_replace("href='histogram.cgi?","href='oreon.php?page=histogram&p=309&",$cgi);
$cgi = str_replace("HREF='histogram.cgi?","href='oreon.php?page=histogram&p=309&",$cgi);
$cgi = str_replace("SRC='histogram.cgi?","src='/nagios/cgi-bin/histogram.cgi?",$cgi);
$cgi = str_replace("src='histogram.cgi?","src='/nagios/cgi-bin/histogram.cgi?",$cgi);

$cgi = str_replace("href='statusmap.cgi?","href='oreon.php?page=statusmap&p=309&",$cgi);
$cgi = str_replace("HREF='statusmap.cgi?","href='oreon.php?page=statusmap&p=309&",$cgi);
$cgi = str_replace("SRC='statusmap.cgi?","src='/nagios/cgi-bin/statusmap.cgi?",$cgi);
$cgi = str_replace("src='statusmap.cgi?","src='/nagios/cgi-bin/statusmap.cgi?",$cgi);

echo $cgi;
?>


Then you have to modify:
1. menu.php to add a link:

<tr>
<td style="white-space: nowrap;">img/picto1.gif&nbsp ;<? echo "Nagios Resume" ?> (oreon.php?page=status&p=309)</td>
</tr>


2. oreon.php

Code:
case 309: if (check_law($p, $oreon->user->get_status())) include ("./YOUR_FILE_NAME.php"); else include ("./alt_error.php"); break ;


Hoping it will help!

wistof
18th August 2005, 16:36
Someone find a solution on the french forum.... sorry... :wink:
Look at:
http://www.oreon.org/Forum/ftopic741-contrib_inclusion_de_nagios_dans_oreon.html

If you don't speak french, i will try to translate.

i don't think this about integration of nagios statusmap but Oreon 'traffic map' feature (Monitoring > Development > Traffic Map )

Lap
18th August 2005, 16:43
Oups... :oops: