Customising Opsview Web application
Status screens
The status screens under /status and /viewports use the latest CSS techniques to separate presentation from the status information. You can override the base CSS by updating the file /usr/local/nagios/share/stylesheets/custom.css. This file will not be changed on an upgrade.
For instance, if you want to change the colours of the hosts and services in the handled column, you can set:
td.handled .ok { background-color: #ccffcc; }
td.handled .warning { background-color: #ffff99; }
td.handled .critical { background-color: #ffcccc; }
td.handled .unknown { background-color: #ffffcc; }
td.handled .up { background-color: transparent; }
td.handled .down { background-color: #ffcccc; }
td.handled .unreachable { background-color: #ffcccc; }
Changing the number of rows on list pages
To amend the number of rows retuned on pages such as the Audit Log a configuration entry can be put into the opsview_web_local.yml file as follows:
Controller::Admin::Auditlog: default_rows: 100
Similar changes can be made to the hosts or service lists by adding an entry such as
Controller::Admin::Host: default_rows: 100
opsview-web must be restarted for these changes to take effect, and they will be preserved over any upgrade.
Warning: This file is yml based, so is very peculiar about whitespace. Do not use tabs - it must be spaces to separate the file. Examine the format of the opsview_web.yml file carefully
Side navigation menus
The side navigation menus, or sidenav, can be changed by editing the /usr/local/opsview-web/opsview_web.yml file. The relevant portion is:
Controller::SideNav:
menus:
- name: Status
display: 1
entries:
- url: '/status/hostgroup'
name: 'Hostgroup Hierarchy'
- url: '/cgi-bin/statusmap.cgi?host=all'
name: 'Network Map'
- url: '/status/service'
name: 'Service Detail'
- url: '/status/host?hostgroupid=1'
name: 'Host Detail'
- name: Search Host
custom: host_search_box
- name: Alerts
entries:
- url: '/status/service?filter=unhandled&order=state_desc&order=host&order=service&includeunhandledhosts=1'
name: 'All Unhandled'
- url: '/status/host?hostgroupid=1&state=1'
name: 'Host - All'
- url: '/status/service?state=1&state=2&state=3&order=state_desc&order=host&order=service'
name: 'Service - All'
- url: '/status/service?state=1'
name: 'Service - Warning'
You can change this and then restart Opsview Web to take effect.
Unfortunately, this section cannot be copied into opsview_web_local.yml because of the nature of the data structure. As opsview_web.yml is overwritten on upgrades, you will need to re-apply your changes manually when you upgrade Opsview.