The Opmantek team was requested to add a feature to NMIS by one of our commercial customers to play a sound when events were displayed on the NMIS dashboard.  This has been added to NMIS 8.5.2G and is dependant on a HTML5 compliant browser (all modern browsers are compliant, IE 6 is NOT).  

Features paid for by customers are made available at no charge to the community, in this way NMIS continues to develop and grow.

Feature Overview

The feature is fairly simple but quite powerful, it works from the Log Viewer logs.pl, when viewing all the current events or syslogs, it will count all the criticality's and then depending on the configuration, play a sound for the most critical level.  This will be checked each time the widget is refreshed, which by default is 180 seconds, configured with "page_refresh_time".  The

and I made this as simple as I could, I assumed that they would only want one sound played on a log display refresh, so the most critical event should make a sound, the policy is simple, if there is no sound file for a level, then nothing will play, you can also change the order if you want to, this is the config extract is below.

Configuration

The configuration for this feature is a new section in the NMIS Configuration file Config.nmis usually /usr/local/nmis8/conf/Config.nmis, the new section is called "sound" and is included in the Config template /usr/local/nmis8/install/Config.nmis, the default configuration is below.  This configuration would only play a sound for fatal, critical and major events.

  'sound' => {
    'sound_levels' => 'fatal,critical,major,minor,warning,normal',
    'sound_type' => 'audio/wav',
    'sound_fatal' => '/nmis8/events/fatal.wav',
    'sound_critical' => '/nmis8/events/critical.wav',
    'sound_major' => '/nmis8/events/major.wav',
    'sound_minor' => undef,
    'sound_warning' => undef,
    'sound_normal' => undef,
  },

If you have upgraded NMIS from a previous version, the installer should have added this already, if not you can merge in new configuration changes with this command:

/usr/local/nmis8/admin/updateconfig.pl /usr/local/nmis8/install/Config.nmis /usr/local/nmis8/conf/Config.nmis

Customising Sound Files

This feature uses the HTML5 audio tag, which support OGG, MP3 and WAV file formats, all the sounds must be the same type, this is set using the sound_type option, the valid options are, audio/mpeg, audio/ogg, audio/wav.  There are many free utilities for converting sound files.

Noticing Changes

You might like to configure the feature to play a quiet pleasing beep or ping noise when the worst thing is normal or warning, and other sounds which are progressively more insistent and urgent as the criticality approaches fatal.  The operations teams using this will normalise the "normal" sound very quickly and they will notice when they do not hear that sound.

 

 

So for the events being displayed check them in the order of sound_level, if there are any events play that level sound, easy to disable, easy to change the sound, simple to implement.  This is all thanks to the new HTML5 tag audio

 

You will need to extract the attached ZIP file into a new folder /usr/local/nmis8/htdocs/events

Assuming this server is NMIS 8.5G, replace logs.pl with the attached logs.pl, likely it would work with other NMIS versions as well.