Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Code Block
  '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'/nmis8/events/minor.wav',
    'sound_warning' => undef'/nmis8/events/warning.wav',
    'sound_normal' => undef'/nmis8/events/normal.wav',
  },

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:

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

Disabling Sound Levels

To only play a sound for fatal and critical events, you can remove the links to the sound files, or change the sound_levels setting.  The later is shown here.

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

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.So you can grab new sound files and replace the existing sounds with your own files, very easy to do.

Sound File Disclaimer

The current sound files were recorded by Keith Sinclair around the time of the birth of NMIS in August 1999.  He makes no apologies for the 16 bit sound and static in the background, at the time, it was state of the art, clearly the art has come along way since then.