Notifiers
TTS Notifier
TTS Notifier
Any number of tts-notifier processes can run simultaneously. All listen directly to the RabbitMQ dashboard.notifiers.tts worker queue and process alarm messages in parallel. This implementation is used for sending email messages containing information about alarms in a format that can be parsed according to the existing OTRS configuration.
Not all messages received from the queue result
in an email message being sent: the
method should_create_ticket()
determines this.
Execution
A tts-notifier process is started by executing the tts_notifier shell script:
Usage: tts_notifier [OPTIONS]
Options:
--hostname TEXT RabbitMQ hostname ["['test-dashboard-
storage01.geant.org', 'test-dashboard-
storage02.geant.org', 'test-dashboard-
storage03.geant.org']"]
--monitoring TEXT monitoring requests exchange name
['mon.requests']
--notifications TEXT external notifications pub/sub
exchange name
['dashboard.external.notifications']
--notifier TEXT notifier worker queue name
['dashboard.notifiers.tts']
--username TEXT RabbitMQ username ['dashboard']
--password TEXT RabbitMQ user password ['password']
--vhost TEXT RabbitMQ vhost ['/dashboard']
--email_host TEXT Email host ['prod-mail.geant.net']
--email_port INTEGER Email host port [25]
--standard_email_sent_from TEXT
Standard from address for messages
to the TT system ['alarm@geant.org']
--gts_email_sent_from TEXT GTS from address for messages to the TT
system ['alarm+gts@geant.org']
--eumetsat_email_sent_from TEXT
EUMETSAT from address for messages to the
TT system ['alarm+eumetsat@geant.org']
--email_to TEXT Email recipient address(es) for
TT messages [required]
--email_username TEXT Email authentication username
--email_password TEXT Email authentication password
--help Show this message and exit.
API
- dashboard.notifications.common.should_create_ticket(notification_message)
Business logic for deciding if a tts ticket should be created.
Namely:
only send email for finalized & critical alarms
don’t an email if one has already been sent
don’t send an email for short-lived alarms
- Parameters:
notification_message – the dict containing alarm info
- Returns:
true iff a ticket should be created
- dashboard.notifications.tts_notifier.handle_message(message, smtp_params)
- dashboard.notifications.tts_notifier.send_message(message, smtp_params)
OTRS Notifier
OTRS Notifier
Any number of otrs-notifier processes can run simultaneously. All listen directly to the RabbitMQ dashboard.notifiers.otrs worker queue and process alarm messages in parallel. This implementation is used for sending messages containing information about alarms to the OTRS API in a format that can be parsed according to the existing OTRS configuration.
Not all messages received from the queue result
in a message being sent: the
method should_create_ticket()
determines this.
Execution
A otrs-notifier process is started by executing the otrs_notifier shell script:
Usage: otrs_notifier [OPTIONS]
Options:
--hostname TEXT RabbitMQ hostname [required]
--monitoring TEXT monitoring requests exchange name
[required]
--notifications TEXT external notifications pub/sub exchange name
[required]
--notifier TEXT notifier worker queue name [required]
--username TEXT RabbitMQ username [required]
--password TEXT RabbitMQ user password [required]
--vhost TEXT RabbitMQ vhost [required]
--otrs_username TEXT OTRS username [required]
--otrs_pwd TEXT OTRS password [required]
--otrs_server_uri TEXT OTRS server uri [required]
--otrs_queue TEXT OTRS queue [required]
--otrs_maintenance_queue TEXT OTRS Maintenance tickets queue
--otrs_maintenance_state TEXT OTRS States used to find active Maintenance
tickets
--customer_user TEXT OTRS customer user [required]
--alarmsdb_hostname TEXT Alarms db hostname [required]
--alarmsdb_port INTEGER Alarms db port
--alarmsdb_name TEXT Alarms db name
--alarmsdb_username TEXT Alarms db username
--alarmsdb_password TEXT Alarms db user password
--tts_cache_duration INTEGER Number of seconds that TTS Maintenance
tickets are cached for
--include-sids / --no-include-sids
Include SIDs in notification message [True]
--field-values FILENAME Path to file containing OTRS default field
values [required]
--help Show this message and exit.
API
- dashboard.notifications.otrs_notifier.process_notification_message(message, otrs_config, include_sids)
Process a notification message
- Parameters:
message – dict containing notification message
otrs_config – Configuration for connecting to OTRS
tts_cache – cache for storing OTRS tickets
include_sids – whether to include SIDs in the details stored in OTRS
- Returns:
OTRS ticket Number
Slack Notifier
Slack Notifier
Any number of slack-notifier processes can run simultaneously. All listen directly to the RabbitMQ dashboard.notifiers.slack worker queue and process alarm messages in parallel. This implementation is used for publishing received alarm messages to Slack.
Execution
A slack-notifier process is started by executing the slack_notifier shell script:
Usage: slack_notifier [OPTIONS]
Options:
--hostname TEXT RabbitMQ hostname ["['test-dashboard-
storage01.geant.org', 'test-dashboard-
storage02.geant.org', 'test-dashboard-
storage03.geant.org']"]
--monitoring TEXT monitoring requests exchange name ['mon.requests']
--notifications TEXT external notifications pub/sub exchange name
['dashboard.external.notifications']
--notifier TEXT notifier worker queue name
['dashboard.notifiers.slack']
--username TEXT RabbitMQ username ['dashboard']
--password TEXT RabbitMQ user password ['password']
--vhost TEXT RabbitMQ vhost ['/dashboard']
--slack_token TEXT Slack token [...]
--slack_channel TEXT Slack channel ['dashboardv3']
--help Show this message and exit.