Skip to main content

In Flashduty


You can obtain an integration push URL through either of these two methods:

Using Private Integration

Choose this method when you don’t need to route alert events to different channels - it’s simpler.

Using Shared Integration

Choose this method when you need to route alerts to different channels based on the alert event payload.

In Nagios


Nagios installation paths may vary depending on the system and installation method. Please adjust the paths in the following configuration according to your actual environment.

Step 1: Download Notification Script

Log in to the Nagios Server host and download the notification script to the Nagios plugin directory:
  • Debian/Ubuntu systems (typically /usr/lib/nagios/plugins/):
cd /usr/lib/nagios/plugins/
wget --header="Referer: https://console.flashcat.cloud" https://download.flashcat.cloud/flashduty/integration/nagios/send_to_flashduty.sh
chmod +x send_to_flashduty.sh
  • RHEL/CentOS systems (typically /usr/lib64/nagios/plugins/):
cd /usr/lib64/nagios/plugins/
wget --header="Referer: https://console.flashcat.cloud" https://download.flashcat.cloud/flashduty/integration/nagios/send_to_flashduty.sh
chmod +x send_to_flashduty.sh
  • Source installation (typically /usr/local/nagios/libexec/):
cd /usr/local/nagios/libexec/
wget --header="Referer: https://console.flashcat.cloud" https://download.flashcat.cloud/flashduty/integration/nagios/send_to_flashduty.sh
chmod +x send_to_flashduty.sh
Note: The script uses the curl command. Please ensure curl is installed on your Nagios Server.

Step 2: Create Flashduty Configuration File

Download the Flashduty configuration file to the Nagios configuration directory:
  • Debian/Ubuntu systems (typically /etc/nagios3/conf.d/):
cd /etc/nagios3/conf.d/
wget --header="Referer: https://console.flashcat.cloud" https://download.flashcat.cloud/flashduty/integration/nagios/flashduty.cfg
  • RHEL/CentOS systems (typically /etc/nagios/objects/):
cd /etc/nagios/objects/
wget --header="Referer: https://console.flashcat.cloud" https://download.flashcat.cloud/flashduty/integration/nagios/flashduty.cfg
  • Source installation (typically /usr/local/nagios/etc/objects/):
cd /usr/local/nagios/etc/objects/
wget --header="Referer: https://console.flashcat.cloud" https://download.flashcat.cloud/flashduty/integration/nagios/flashduty.cfg

Step 3: Modify Configuration File

Edit the downloaded flashduty.cfg file and modify the following:
  1. Replace the pager field value with the integration push URL obtained from the Flashduty console
  2. Modify the script path in command_line according to your Nagios installation path
Configuration file example:
define contact {
    contact_name                    Flashduty
    alias                           Flashduty Alert Receiver
    service_notification_commands   notify-service-by-Flashduty
    host_notification_commands      notify-host-by-Flashduty
    service_notification_options    w,u,c,r
    host_notification_options       d,u,r
    service_notification_period     24x7
    host_notification_period        24x7
    pager                           <YOUR_FLASHDUTY_PUSH_URL>
}

define command {
    command_name    notify-host-by-Flashduty
    command_line    <NAGIOS_PLUGIN_PATH>/send_to_flashduty.sh type=HOST WEBHOOK_URL="$CONTACTPAGER$" hostname="$HOSTNAME$" state="$HOSTSTATE$" output="$HOSTOUTPUT$" notification_type="$NOTIFICATIONTYPE$" time="$LONGDATETIME$" host_address="$HOSTADDRESS$" host_alias="$HOSTALIAS$" check_command="$HOSTCHECKCOMMAND$"
}

define command {
    command_name    notify-service-by-Flashduty
    command_line    <NAGIOS_PLUGIN_PATH>/send_to_flashduty.sh type=SERVICE WEBHOOK_URL="$CONTACTPAGER$" hostname="$HOSTNAME$" state="$SERVICESTATE$" output="$SERVICEOUTPUT$" notification_type="$NOTIFICATIONTYPE$" time="$LONGDATETIME$" host_address="$HOSTADDRESS$" service_desc="$SERVICEDESC$" host_alias="$HOSTALIAS$" max_attempts="$MAXSERVICEATTEMPTS$"
}
Parameter descriptions:
  • pager: Flashduty push URL, the integration push URL obtained from the Flashduty console
  • <NAGIOS_PLUGIN_PATH>: Replace with the actual script path, such as /usr/local/nagios/libexec
  • service_notification_options: Service alert notification options, w=warning, u=unknown, c=critical, r=recovery
  • host_notification_options: Host alert notification options, d=down, u=unreachable, r=recovery
Tip: To include additional information in alerts, you can append parameters in key=value format at the end of command_line, for example: environment="production" region="$_HOSTREGION$". These parameters will be pushed to Flashduty as labels.

Step 4: Include Configuration File

If you are using RHEL/CentOS systems or source installation, you need to include the Flashduty configuration file in the Nagios main configuration file.
  • RHEL/CentOS systems: Edit /etc/nagios/nagios.cfg and add:
cfg_file=/etc/nagios/objects/flashduty.cfg
  • Source installation: Edit /usr/local/nagios/etc/nagios.cfg and add:
cfg_file=/usr/local/nagios/etc/objects/flashduty.cfg
Note: Debian/Ubuntu systems typically auto-load all configuration files in the /etc/nagios3/conf.d/ directory, so manual inclusion is not required.

Step 5: Add Flashduty to Contact Group

Edit the contacts configuration file to add the Flashduty contact to the admins contact group (or another contact group you use):
  • Debian/Ubuntu systems: Edit /etc/nagios3/conf.d/contacts_nagios2.cfg
  • RHEL/CentOS systems: Edit /etc/nagios/objects/contacts.cfg
  • Source installation: Edit /usr/local/nagios/etc/objects/contacts.cfg
Find the contact group definition and add Flashduty to the members list:
define contactgroup {
    contactgroup_name       admins
    alias                   Nagios Administrators
    members                 nagiosadmin,Flashduty
}

Step 6: Verify Configuration and Restart Service

  1. Verify the Nagios configuration file:
  • Debian/Ubuntu systems:
/usr/sbin/nagios3 -v /etc/nagios3/nagios.cfg
  • RHEL/CentOS systems:
/usr/sbin/nagios -v /etc/nagios/nagios.cfg
  • Source installation:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
  1. If verification passes, restart the Nagios service:
# Debian/Ubuntu
systemctl restart nagios3

# RHEL/CentOS/Source installation
systemctl restart nagios
  1. After configuration is complete, Nagios will automatically push alerts to Flashduty when detected.

Status Mapping


Nagios to Flashduty alert severity mapping:
NagiosFlashdutyStatus
CRITICALCriticalCritical
DOWNCriticalCritical
UNREACHABLECriticalCritical
WARNINGWarningWarning
OKOkRecovered
UPOkRecovered
UNKNOWNInfoInfo