Nagios
Parny supports direct integration with Nagios alerts. Nagios is a network and system monitoring tool that can create alarms to detect and prevent potential problems. This documentation explains how to redirect alarms created in Nagios to a webhook using Parny.
Service Name Usage: The service name here is independent of the structure and can be chosen according to the preferences of the organization.
This section discusses an "Adding Alert Notification" and "Redirecting Alarms".
define contact {
contact_name parny
alias Parny
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-service-by-parny
host_notification_commands notify-host-by-parny
}
define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin, slack, parny
}
##############PARNY##################
define command {
command_name notify-service-by-parny
command_line /usr/local/bin/parny-new.sh "$HOSTNAME$" "$HOSTOUTPUT$" "$SERVICEDESC$"
}
define command {
command_name notify-host-by-parny
command_line /usr/local/bin/parny-new.sh "$HOSTNAME$" "$HOSTOUTPUT$" "$HOSTSTATE$"
}
#!/usr/bin/env bash
date=$(date +%Y-%m-%d)
echo "$date"
PARNY_URL=https://nagios.parny.io/alert/******
hosts_total=$(( $NAGIOS_TOTALHOSTSUP + $NAGIOS_TOTALHOSTSDOWN ))
services_total=$(( $NAGIOS_TOTALSERVICESOK + $NAGIOS_TOTALSERVICEPROBLEMS ))
DATA="{
\"embeds\":
{
\"hostname\": \"($1)\",
\"description\": \"$2\",
\"hoststate\": \"$3\",
\"datetime\": \"$date\"
}
}"
curl -4 -X POST --data "$DATA" $PARNY_URL
exit $?
With these settings, your Nagios alarms will be forwarded to Parny, allowing you to manage them alongside your other alerts within your organization's Parny interface.