In Zabbix 1.6.4, I've noticed that if you disable the guest account, Zabbix does not redirect you to the page you originally entered before you log in. For example, if you enter http://zabbix-server/events.php, it will prompt you for a login. After you login, it will either redirect you to the url configured in the user profile or to index.php instead of events.php. This is a simple change to index.php which specifically addresses this situation:
1. Guest account is disabled so that the user name of the person acknowledging an alert is logged.
2. A URL is used in actions to email a message alert with a link to acknowlege the alert (i.e. http://zabbix-server/acknow.php?eventid={EVENT.ID}).
3. You want users to click on the URL in the email to acknowlege a specific alert directly instead of having to go to the events page and sort through a large number of alerts.
Potential downside: Users will not be redirected to the last page they were on in their previous login.
To make this change, modify {zabbix-dir}/php/index.php:
Change:
if(empty($row['url'])){
$row['url'] = get_profile('web.menu.view.last','index.php');
}
To:
if(empty($row['url'])){
$row['url'] = get_profile('web.menu.view.last','index.php');
if(isset($_SERVER['HTTP_REFERER'])){
$row['url'] = $_SERVER['HTTP_REFERER'];
}
}
This will use the php $_SERVER['HTTP_REFERER'] variable to redirect the user to the URL entered prior to login.
1. Guest account is disabled so that the user name of the person acknowledging an alert is logged.
2. A URL is used in actions to email a message alert with a link to acknowlege the alert (i.e. http://zabbix-server/acknow.php?eventid={EVENT.ID}).
3. You want users to click on the URL in the email to acknowlege a specific alert directly instead of having to go to the events page and sort through a large number of alerts.
Potential downside: Users will not be redirected to the last page they were on in their previous login.
To make this change, modify {zabbix-dir}/php/index.php:
Change:
if(empty($row['url'])){
$row['url'] = get_profile('web.menu.view.last','index.php');
}
To:
if(empty($row['url'])){
$row['url'] = get_profile('web.menu.view.last','index.php');
if(isset($_SERVER['HTTP_REFERER'])){
$row['url'] = $_SERVER['HTTP_REFERER'];
}
}
This will use the php $_SERVER['HTTP_REFERER'] variable to redirect the user to the URL entered prior to login.
Comment