Versions Compared

Key

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

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.

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

...

Code Block
/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.

...