NAGIOS_ (NAGIOS_HOSTNAME, NAGIOS_SERVICEDESC, NAGIOS_NOTIFICATIONTYPE and so on). A script pushes that content to Flashduty in the Standard Alert Event format: problem notifications trigger alerts and recovery notifications close them.
In Flashduty On-call
Get an integration push URL in either of the two ways below. Choose the Standard Alert Event integration type in both, not Opsview.Use a dedicated integration
- In the Flashduty console, go to Channels and open a channel
- Go to Settings → Integrations → Dedicated integrations and click Add integration
- Select Standard Alert Event and click Save
- Open the generated integration card and copy the Push URL, in the form
https://api.flashcat.cloud/event/push/alert/standard?integration_key=<integration key>
Use a shared integration
- In the Flashduty console, go to Integration Center → Alert Events
- Select Standard Alert Event and enter an integration name
- Configure the default route and select a channel. You can add more rules under Routing after creation
- Click Save and copy the generated Push URL
Configure in Opsview
1
Create the notification script on the Orchestrator
Where: Opsview Orchestrator server › notify_by_flashdutyEvery environment variable the script reads is in the notification variable list of the Opsview documentation. The script handles them as follows:
2
Import the script on the Orchestrator and apply changes
Where: Terminal of the Opsview Orchestrator server; Opsview › Configuration › Apply ChangesOn the Orchestrator, import the script as the Then go to Configuration › Apply Changes to finish installing the script.
opsview user:3
Add the notification method in Opsview
Where: Opsview › Configuration › Notification Methods › Add New
After saving, go to Configuration › Apply Changes again to activate the new notification method.
4
Add the method to a user's notification profile
Where: Opsview › Configuration › Users and Roles › Users › edit the user › Notification Profiles › Add NewOpsview notifications are driven by each user’s Notification Profile, so every user who should receive Flashduty notifications must select this method (you can also open My Profile from your username at the top right):
Click Update, then Submit Changes, and finally go to Configuration › Apply Changes to make it live.You can also create a shared profile under Shared Notification Profiles and assign it to several users.
5
Test the script with test_notifications and confirm a real alert
Where: Terminal of the Opsview Orchestrator serverOpsview provides a The test sends a real event to Flashduty; once the alert appears, close it manually in Flashduty. The integration shows Latest event time, which means the script and push URL are correct. The test bypasses the notification method and the Notification Profile, so it does not prove they work: make a monitored object in Opsview actually leave the OK state and then recover, and confirm both the problem and recovery notifications reach Flashduty. If no alert appears, use “Troubleshooting” below to see the environment variables the script actually receives.
test_notifications tool that simulates the environment variables Nagios Core sets at notification time; use it to test the script:If the notification method is set to run on a Collector, test the script on the Collector servers as well.
Recovery and deduplication
- A host or service always uses the same Alert Key, so repeated problem notifications (for example from Opsview’s re-notification interval) only update the same alert, and the
RECOVERYnotification recovers it - When a service goes from WARNING to CRITICAL, the severity is updated on the same alert
- Acknowledgement (
ACKNOWLEDGEMENT), flapping (FLAPPING*) and downtime (DOWNTIME*) notifications are ignored by the script and produce no event in Flashduty
Troubleshooting
- No alert arrives: confirm the Notification Profile selects
Flashdutyand Apply Changes was run; check in Opsview’s Notifications View whether the notification was sent; test the script on its own withtest_notifications - The test works but real alerts are not pushed: in a real notification the script reads the environment variables Opsview passes; add
{ date; echo "Called with $@"; env; echo; } >> /tmp/env.txtto the top of the script (the debugging method given in the Opsview documentation) to see what it actually receives - The alert does not recover: confirm the Notification Profile ticks the recovery states; Nagios only sends a recovery notification after a problem notification was sent
- Flashduty returns a parameter error: confirm the push URL in
Commandis complete, includingintegration_key