Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,796
Community Members
 
Community Events
184
Community Groups

Issue with Nagios2Opsgenie

Edited

I'm just starting to integrate our Nagios with Opsgenie.  I created a service template and assigned it to a test service.  In the logs, when switching to criticals I see nagios2opsgenie being called but I get the following warning:

WARNING Stopping, Nagios NOTIFICATIONTYPE param has no value, please make sure your Nagios and OpsGenie files pass necessary parameters

 

My service is defined with the following:

define service {
   name ops-genie-notify
   service_description /usr/local/nagios/bin/nagios2opsgenie
   display_name Nagiso to OpsGenie
   use passive_service
   check_command notify-service-by-opsgenie
   is_volatile 0
   max_check_attempts 1
   active_checks_enabled 0
   passive_checks_enabled 1
   check_period 24x7
   check_freshness 0
   event_handler notify-service-by-opsgenie
   event_handler_enabled 1
   flap_detection_enabled 0
   retain_status_information 1
   retain_nonstatus_information 1
   notification_interval 60
   notification_period 24x7
   notification_options c,r
   notifications_enabled 1
   stalking_options c
   _AlertTeam MOC
   register 0
}

 

The command is defined as:

define command {
command_name notify-service-by-opsgenie
command_line /usr/local/nagios/bin/nagios2opsgenie -entityType=service -t="$NOTIFICATIONTYPE$" -ldt="$LONGDATETIME$" -hn="$HOSTNAME$" -hdn="$HOSTDISPLAYNAME$" -hal="$HOSTALIAS$" -haddr="$HOSTADDRESS$" -hs="$HOSTSTATE$" -hsi="$HOSTSTATEID$" -lhs="$LASTHOSTSTATE$" -lhsi="$LASTHOSTSTATEID$" -hst="$HOSTSTATETYPE$" -ha="$HOSTATTEMPT$" -mha="$MAXHOSTATTEMPTS$" -hei="$HOSTEVENTID$" -lhei="$LASTHOSTEVENTID$" -hpi="$HOSTPROBLEMID$" -lhpi="$LASTHOSTPROBLEMID$" -hl="$HOSTLATENCY$" -het="$HOSTEXECUTIONTIME$" -hd="$HOSTDURATION$" -hds="$HOSTDURATIONSEC$" -hdt="$HOSTDOWNTIME$" -hpc="$HOSTPERCENTCHANGE$" -hgn="$HOSTGROUPNAME$" -hgns="$HOSTGROUPNAMES$" -lhc="$LASTHOSTCHECK$" -lhsc="$LASTHOSTSTATECHANGE$" -lhu="$LASTHOSTUP$" -lhd="$LASTHOSTDOWN$" -lhur="$LASTHOSTUNREACHABLE$" -ho="$HOSTOUTPUT$" -lho="$LONGHOSTOUTPUT$" -hpd="$HOSTPERFDATA$" -s="$SERVICEDESC$" -sdn="$SERVICEDISPLAYNAME$" -ss="$SERVICESTATE$" -ssi="$SERVICESTATEID$" -lss="$LASTSERVICESTATE$" -lssi="$LASTSERVICESTATEID$" -sst="$SERVICESTATETYPE$" -sa="$SERVICEATTEMPT$" -msa="$MAXSERVICEATTEMPTS$" -siv="$SERVICEISVOLATILE$" -sei="$SERVICEEVENTID$" -lsei="$LASTSERVICEEVENTID$" -spi="$SERVICEPROBLEMID$" -lspi="$LASTSERVICEPROBLEMID$" -sl="$SERVICELATENCY$" -set="$SERVICEEXECUTIONTIME$" -sd="$SERVICEDURATION$" -sds="$SERVICEDURATIONSEC$" -sdt="$SERVICEDOWNTIME$" -spc="$SERVICEPERCENTCHANGE$" -sgn="$SERVICEGROUPNAME$" -sgns="$SERVICEGROUPNAMES$" -lsch="$LASTSERVICECHECK$" -lssc="$LASTSERVICESTATECHANGE$" -lsok="$LASTSERVICEOK$" -lsw="$LASTSERVICEWARNING$" -lsu="$LASTSERVICEUNKNOWN$" -lsc="$LASTSERVICECRITICAL$" -so="$SERVICEOUTPUT$" -lso="$LONGSERVICEOUTPUT$" -snu="$SERVICENOTESURL$" -spd="$SERVICEPERFDATA$"
register 1
}

 

In looking at the golang script notification type is set with the flag t but that doesn't do anything.  

I've tried with the arguments, without, pretty much everything I can think of but doesn't seem like my service command is configured correctly.  

Does anyone have an example that I can use to see what I'm missing here?  

Thanks!

1 answer

Neverrmind, apparently NOTIFICATIONTYPE is not used in service checks so it's sending an empty string.  I just switched it to be "PROBLEM" and that worked fine.  Though I guess my question would be if I want to send OpsGenie a message when a service goes to critical using a check service command, why is nagios2opsgenie expecting a non-empty string in the notification type field?

Hi - did you ever work out a fix - we're having the same issue with service alerts into opsgenie.

Thanks,

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events