url-item '&name=' - please help!
Moderators: Developers, Moderators
-
- Posts: 11
- Joined: Tue May 10, 2011 4:24 am
- Location: Germany
url-item '&name=' - please help!
Hi everyone!
I opened a thread in the wrong sub-section yesterday. So i hope this is the correct section now.
Old thread: http://forums.cacti.net/viewtopic.php?f=5&t=42717
As mentioned in the above listet thread my url-item '&name=HOSTNAME' isn't working anymore. Till now i verified even elder versions - back to 0.8.7d - in none it's working. Somehow very strange, cause with 0.8.7e on opensuse 10.3 it worked like a charm!
Is there another url-item or variable i can use call the desired device via url? host_id isn't an alternative cause in nagios my systems are listed via hostname.
I hope someone can help - i'm very confused about this behavior. Especially cause the old system is still running fine and working like a charm... oO
Best regards from germany,
Jörg
I opened a thread in the wrong sub-section yesterday. So i hope this is the correct section now.
Old thread: http://forums.cacti.net/viewtopic.php?f=5&t=42717
As mentioned in the above listet thread my url-item '&name=HOSTNAME' isn't working anymore. Till now i verified even elder versions - back to 0.8.7d - in none it's working. Somehow very strange, cause with 0.8.7e on opensuse 10.3 it worked like a charm!
Is there another url-item or variable i can use call the desired device via url? host_id isn't an alternative cause in nagios my systems are listed via hostname.
I hope someone can help - i'm very confused about this behavior. Especially cause the old system is still running fine and working like a charm... oO
Best regards from germany,
Jörg
Re: url-item '&name=' - please help!
I've not heard about "name=" parameter ever...
Instead, try this: "filter=$HOSTALIAS$"
Instead, try this: "filter=$HOSTALIAS$"
-
- Posts: 11
- Joined: Tue May 10, 2011 4:24 am
- Location: Germany
Re: url-item '&name=' - please help!
Hi noname,
'filter=...' is not working, cause the browser is saving last host_id, so when i set a filter, i manually have to set the correct device. Just then i will see the correct graphs. When i manually switch to another device, the filter is still applied, so no graphs are shown until i remove '&filter=...' from the url.
Do you know another parameter to directly call a device by it's hostname/devicename? Or is there an list existing that show's all url-parameter?
Thanks in advance,
Jörg
'filter=...' is not working, cause the browser is saving last host_id, so when i set a filter, i manually have to set the correct device. Just then i will see the correct graphs. When i manually switch to another device, the filter is still applied, so no graphs are shown until i remove '&filter=...' from the url.
Do you know another parameter to directly call a device by it's hostname/devicename? Or is there an list existing that show's all url-parameter?
Thanks in advance,
Jörg
Re: url-item '&name=' - please help!
I tested "name=" in Cacti 0.8.7e (fresh installed), but not worked.
Some discussions existed in the past...
- http://forums.cacti.net/viewtopic.php?f=21&t=17984
- http://forums.cacti.net/viewtopic.php?f=21&t=29431
- http://forums.cacti.net/viewtopic.php?f=21&t=30162
Okay, I'll try too.
In 'graph_view.php' (0.8.7g) at around line 180:
Result is:
This works in preview mode only. But at your own risk.
Some discussions existed in the past...
- http://forums.cacti.net/viewtopic.php?f=21&t=17984
- http://forums.cacti.net/viewtopic.php?f=21&t=29431
- http://forums.cacti.net/viewtopic.php?f=21&t=30162
Okay, I'll try too.
In 'graph_view.php' (0.8.7g) at around line 180:
Code: Select all
/* if the user pushed the 'clear' button */
if (isset($_REQUEST["clear_x"])) {
kill_session_var("sess_graph_view_current_page");
kill_session_var("sess_graph_view_filter");
kill_session_var("sess_graph_view_graph_template");
kill_session_var("sess_graph_view_host");
unset($_REQUEST["page"]);
unset($_REQUEST["filter"]);
unset($_REQUEST["host_id"]);
unset($_REQUEST["graph_template_id"]);
unset($_REQUEST["graph_list"]);
unset($_REQUEST["graph_add"]);
unset($_REQUEST["graph_remove"]);
+ unset($_REQUEST["hostname"]);
}
+ /* determine host_id from hostname */
+ if (isset($_REQUEST["hostname"])) {
+ $_REQUEST["host_id"] = db_fetch_cell("SELECT id FROM host WHERE hostname = '" . $_REQUEST["hostname"] . "'");
+ }
/* reset the page counter to '1' if a search in initiated */
if (isset($_REQUEST["filter"])) {
$_REQUEST["page"] = "1";
}
load_current_session_value("host_id", "sess_graph_view_host", "0");
load_current_session_value("graph_template_id", "sess_graph_view_graph_template", "0");
load_current_session_value("filter", "sess_graph_view_filter", "");
load_current_session_value("page", "sess_graph_view_current_page", "1");
This works in preview mode only. But at your own risk.
-
- Posts: 11
- Joined: Tue May 10, 2011 4:24 am
- Location: Germany
Re: url-item '&name=' - please help!
@noname:
Thanks man, you made my day!!!!
I'm not into php - so a very thank you to you. I guess it's time dig into that...
Best regards,
Jörg
Thanks man, you made my day!!!!
I'm not into php - so a very thank you to you. I guess it's time dig into that...
Best regards,
Jörg
Re: url-item '&name=' - please help!
NOTICE:
"Clear" button works, but hostname in URL is still remain as well as "filter=" (and other parameters),
so "hostname=" is applied again when you clicked "graph" tab. Sorry.
"Clear" button works, but hostname in URL is still remain as well as "filter=" (and other parameters),
so "hostname=" is applied again when you clicked "graph" tab. Sorry.
-
- Posts: 11
- Joined: Tue May 10, 2011 4:24 am
- Location: Germany
Re: url-item '&name=' - please help!
is there an option to clean up the url when calling another device or by clicking the "graphs"-button?
may this be a interesting patch for regular cacti-releases? especially for nagios-integration.
may this be a interesting patch for regular cacti-releases? especially for nagios-integration.
Re: url-item '&name=' - please help!
It seems to be able to partly resolve.pfeufjoeadidas wrote:is there an option to clean up the url when calling another device or by clicking the "graphs"-button?
Add this line:
Code: Select all
/* determine host_id from hostname */
if (isset($_REQUEST["hostname"])) {
$_REQUEST["host_id"] = ...
+ unset($_SESSION["sess_graph_view_url_cache"]);
}
Re: url-item '&name=' - please help!
Nice! Thanks for posting this!
Another option you would have is to query the description field instead. If you always set that to the system's shortname (and you know your devices have unique short names), you could use the shortname in the URL.
Here's my REQUEST line:
Another option you would have is to query the description field instead. If you always set that to the system's shortname (and you know your devices have unique short names), you could use the shortname in the URL.
Here's my REQUEST line:
Code: Select all
$_REQUEST["host_id"] = db_fetch_cell("SELECT id FROM host WHERE description = '" . $_REQUEST["hostname"] . "'");
-
- Posts: 11
- Joined: Tue May 10, 2011 4:24 am
- Location: Germany
Re: url-item '&name=' - please help!
This is exactly what i have done. I needed to change to description, cause i have my systems different times in my devices-list - always with other options.
I'm using this setup to create specified reports.
And nagios infront of it is the best i know - especially combined with ninja.
Best regards,
Jörg
I'm using this setup to create specified reports.
And nagios infront of it is the best i know - especially combined with ninja.
Best regards,
Jörg
Who is online
Users browsing this forum: No registered users and 3 guests