Hi all!
New here and fairly new to Icinga2, coming from a Nagios/Opsview background however, I’ve been looking at making nicer url’s and possibly have these work with variables to redirect users to custom searches.
For examples:
going to icinga.companydomain.com/dev
should redirect to
https://icinga.companydomain.com/monitoring/list/services?host=*.dev.*&service_state!=OK&limit=500&sort=host_display_name&modifyFilter=1
Ideally we want to use this a variable to changing dev to “live” would change dev in the actual url to live also but this isn’t required as I don’t mind adding a few differing rules to cover each of our environments.
However no matter where I put the rewrite in the config it doesn’t work, it either breaks icingaweb entirely or it no change seems to be made at all.
the rewrite line im using is:
RewriteRule ^dev$ monitoring/list/services?host=%2A.dev.%2A&service_state!=OK&limit=500&sort=host_display_name&modifyFilter=1 [NC,L]
The rest of the apache config is as follows(standard icingaweb2 conf as far as i can tell), this is our current live config without my edit due to the issues it was causing.
<Directory “/usr/share/icingaweb2/public”>
Options SymLinksIfOwnerMatch
AllowOverride None
SetEnv ICINGAWEB_CONFIGDIR “/etc/icingaweb2”
EnableSendfile Off
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>
<IfModule !mod_rewrite.c>
DirectoryIndex error_norewrite.html
ErrorDocument 404 /error_norewrite.html
</IfModule>
Could anyone give suggestions, I’m hoping I’m just being slow and somethinghasn’t clicked that’s simple but after much searching and confirming the rewrite works on a standard apache host I’m at a slight loss.
Thanks in advance! loving icinga so far and looking to get to know it more