Add incident.io alert integration for Icinga2
- New notification script (incidentio-notification.sh) that POSTs JSON
payloads to incident.io HTTP alert sources via curl/jq
- New Icinga2 config template defining User, NotificationCommand (host
+ service), and apply Notification rules — follows the PagerDuty
pattern with opt-in via vars.enable_incidentio
- Notification type mapping: PROBLEM/DOWN/CRITICAL/WARNING/UNKNOWN →
firing, RECOVERY/UP/OK → resolved, ACKNOWLEDGEMENT → firing with
metadata
- Deduplication keys: host-{name} for hosts, service-{host}-{service}
for services
- Deployed via Ansible: script copied to /etc/icinga2/scripts/,
config rendered to conf.d/; gated on icinga2_incidentio_token being
defined
This commit is contained in:
parent
5171f6666c
commit
edd689d8c7
6 changed files with 400 additions and 173 deletions
|
|
@ -1,173 +1,179 @@
|
|||
$ANSIBLE_VAULT;1.1;AES256
|
||||
33303162376164613464623864323932616634653932343066383263356564396232336531613039
|
||||
6662663537373133373963353638363261613066343064340a366662633237333633376266616561
|
||||
39383563343339373833323131336633333564613161633334633662326331396461623261313966
|
||||
3535373432666430340a343138656237633133636634333562343539663765303361613032306663
|
||||
61653165656562306162613536623936326465326132323034306361326138376336343438623430
|
||||
34383230396333366338643535666530353734343864376233313730343365613962386438646439
|
||||
33393062346136303631656635316337353937663330633463623537613531336463316665636132
|
||||
35626531393332336532323332393933316434653366633830666130333636303066623561663637
|
||||
64366566656366643563666337383835303733653261373032633066383730336136346665303833
|
||||
65346662373062373836333430306163663535373665386334353235313464623330336363326165
|
||||
39386361363039356166303133353739626162613637633930343131643030386463663537366361
|
||||
66626538663836646532636134346230623637626233633866346165396566383731313137303265
|
||||
31386632656466313864626235393434626638646564646162356365333530633536356436373436
|
||||
32313932323632663438343330636264373365336139616536343332623830616537663030316535
|
||||
36393238323465636533353832303264616438626630343963303032623763393533376161633138
|
||||
33653864363663633730333864303636333733653562323264323937363738656664343830386566
|
||||
30326163646338323334303937653739613238663661643132616665653031373832366135363864
|
||||
61623338343963636165373535306266646338656266643539383037656566663961336333643739
|
||||
33373332353334373035386438353232333661653961653465646231616264633738663064643738
|
||||
34616632663265343630626262646237363864373262396239353538623534643762333934383561
|
||||
39383931383161373965623337386430633762643366323965366439666263313833353561356232
|
||||
32353238336139343161356130343034393366353138346130666339376633333734393365383666
|
||||
65396430373664336562323438626136623633326561303630383038336539396262653032636335
|
||||
30656138373064663934663035323163313332333433306430313963393539306362623539393034
|
||||
64376238386230336138633137653662636262323561386564346538313564366636613866623836
|
||||
33623134333166313164623739383832666666396461656438616635376331623563376363623965
|
||||
32616537363861623262366437663637636563353034353932363264656263393035373461666162
|
||||
65633235643438393362323164393736363665643335326234323633613335323166616539633639
|
||||
39333338343338613766353735643266366130306462663433363163386635393639633539616633
|
||||
34393036366432333966366261313938613835373932303166336433623835316237353161616438
|
||||
36383066393732666638313461363133356561353537643663373834333733376432353337386163
|
||||
61633662643930313565326635663363656633316166383563643435616335633162376339336339
|
||||
33373265623837626436393335396133653764376232353564396161386365366538663331613538
|
||||
32363762376463623665373339663635356131616239333265343934353666323731623230343137
|
||||
62313437346531323966663163393562366336393937636137353666363631346333303631356132
|
||||
63613338383463386232313862613731663730376130366332323131343133363666353331653434
|
||||
61343839393333663766363530313362386534393166643062303633333834643838633837336263
|
||||
34663764373766376539373031663032303732356461303663366562646665366237313732613239
|
||||
30333235316630653134343437343939336631666538623264353765636332323763396535386535
|
||||
36363030346632346461643934306634616232336631343435313564396466336539376238393233
|
||||
63663939343838383739393433366239656663373464333337626530643262663432333465623437
|
||||
64656534623563653930333462393038303230643335646630326334653837346433303639326265
|
||||
34323337633338336464613163666534616335643462333234316630656230346161653338333961
|
||||
64643166633939393630643439313461313463383065663932323132343033376562666231326432
|
||||
39616530666435326366353532376536333564383166323232646133373134616335666566306133
|
||||
38336336336138363332343731396535633031626561643232623265336333653136623936323235
|
||||
36303730626530633261653031633563336237363339616536353738623564666666313762653564
|
||||
32663265323562336563613230653334303662663265346338303032646337653937363866663566
|
||||
64336663663164363036303466643739333238396164396631333163383365613830623430373062
|
||||
38343930363331636133376232333766323338666334333939323136333139623061646437343539
|
||||
34323538643030663432343937656438313962623730343330646664393933326463343565313434
|
||||
66353366326463363235613233623364646638346539653938336163643766373537383762643563
|
||||
65373537393666653039363965363362663264356536653263663133613265646431663738633662
|
||||
61303730363132643832393731373062613266363432633338343133633565653437663366323839
|
||||
65633335346564383638656362373436663031316539663339616366326432383436613765616561
|
||||
31633363623762343932663165366563656264343039313761616266653535646662356131336665
|
||||
30346637663165396465346662316537336238343838373566633563313039346633373937663166
|
||||
36393233353165376232613739376463306663343136643633643733336163316663393632396565
|
||||
65336261353766393166613561623332376366346366623135353964343564373763393739646463
|
||||
63383365366265656537303466663437633931343331613163303261363239666531663936623230
|
||||
61636432613861396562376138313161316239653862646533653133653162326664653265393239
|
||||
32333162656339343939616165303966626633333130643739336235633064626661633130316263
|
||||
65393263396131623964373065383839663136623332346637383734356433656539663334376238
|
||||
30636236353738626264336561663564333333613538343938353231633262663733653933666233
|
||||
62663135363061343233333061313530386634376638303238333239303636376331373730613961
|
||||
30333639653765313161666636376631373666393564353532313834336433373734353137646462
|
||||
37613263653338383566366461373362363431356336626630663031336532396333306137353233
|
||||
37636233303631623031663765333466636364653531363430663931306637633966336430353132
|
||||
32626461613736653430663337633136663435663732346330643663653730363939383430363534
|
||||
32366433613464613662303539333238613438346564336462623739393036393733623762643930
|
||||
65623937393437373538656239363166373339303036653638633932373061353165356361666438
|
||||
64333066343564323535646632326130626636393538356437623635313664653030393637613934
|
||||
61663966383134636264373664333666363936346337323661316138353231643035666238623866
|
||||
34303961353631323838346264383338656131346130363135333237353766353634303133373333
|
||||
37623665633731303537326661633332303764343366613339353365623536643961626365343765
|
||||
30386363376161616235623136336237326364356133383036663832333566656234313239353462
|
||||
31336638666563303031333931643766343036373831326433633135376630656233363661343264
|
||||
31346166666332666430656335653338353330383136373932356166633930643932616261626233
|
||||
35663835336138363864356464373265373464653438353637373163343030336364336163663364
|
||||
38653432636366393737633565663464623136326638663437373765373737633038393566333865
|
||||
31393132376238303862656539623737643937643135316563343866353738373232356434356330
|
||||
34623162666563383035343262303232656433363265313238373132363334653034363961623138
|
||||
30316264343831393466393234313035663265643233663532333961653932383565373731313566
|
||||
35323732386161366536366337396665303437346230323438396463623734346537346436376430
|
||||
62336337383530313331386565386334303639333761663032613666306235616134396339633864
|
||||
39633335623038393138666566396565303339326639346362366336306437376366626231356335
|
||||
30633932303963633931303332333630333438653765656237643966383138333963346138396135
|
||||
30363161366364613534666162376334313439303864626233623539653430353464633633353263
|
||||
66633161376564393962363935313932306165653437646661383238626338306430393566633362
|
||||
31663264633734316133323366633439383532303333333033336433333738653037373130643862
|
||||
32343030666631666531393335613932373536343263616565373632626138616537343266326537
|
||||
64333131663162623161353138633132623336653731313032313437656165303461613035653562
|
||||
34613234643364346539363931393837613766313938626132353139626534393865393363633430
|
||||
66333835363834303038613066626638333766333865333032636661353030633363363563393761
|
||||
35333034346337653862376136323064656237343563383832303335303535663238303665666233
|
||||
65613238643333653537643132373033393138313539346465376565663465383561346138356464
|
||||
65626431396532633638613463343264303037336162316634373937626665303363396137643837
|
||||
62643061326132663265383862353330636630653464356336613935396431663531386261376137
|
||||
64323937386334376332343064623639373461366166666136656436623333353738346662613638
|
||||
35626137323162373637663966663863353437323261366232633237636265663531376632373062
|
||||
35343839393134313836313464333631373364366338386637396364653462316430643235353134
|
||||
36386663383236386533316237663364653362653662643237633964663130343633336137326334
|
||||
35363934343239653836303333373862363436393736306231613263353064303338343136373363
|
||||
62353931336536663766646632663365323435373733343462343136616664396363623736613564
|
||||
36363364343761366337393563663532393531353062343266653734363364613839356237626338
|
||||
37616234636137363461323136313034316134306162663136633663653132363465643533313437
|
||||
37373536376262626565653033333662626637393565393235306165333362303530663463386364
|
||||
38353032636237623535386466623939633738303233383963653735333734336132336663383235
|
||||
38346231636565656163613234626464333634323166346534633233326562383166636366306663
|
||||
63633433623539323364316365613235363830336339653962653764633236653862316663353066
|
||||
30386139316266666336653633353633613139633036623037366563323861333632336334336131
|
||||
65386261313834343735636265306363613838373935313963376163396634653134323334643962
|
||||
36613030623834313331366633303766333136633866623235323065393665666535373861376634
|
||||
65393033613333626335376161373435303335633163356364353433313333643639313235396637
|
||||
62663137343835656532336366663839353831396563393162306134623731653763316231376432
|
||||
39386361623838376231356532633232383733663265363434396130646130323734363365663865
|
||||
63386266633539366336653565663063323365396362373631663363326362376361623133633336
|
||||
61396661336236316461333537333038656638313562356461353931323835316531653762613765
|
||||
63343934626161646365353263356434323338653863383333343431393634633933346539323531
|
||||
37306235313731663464393237396262633738363166333330623430663462633963356362646234
|
||||
34623361633731626335643335323336613636356630653532356331633132663739613630663964
|
||||
64626462383062306433303135323538336237623432613030326638633530313539363164313134
|
||||
35663066363337386163356438613939643830623830383761616330323136616339386333626132
|
||||
61363030353966616461646435333137336538343533643831303935373638393834383265343831
|
||||
61326331653835623935373330333138643634366432336464336563616238396138623131333434
|
||||
65663636656331643432333865336330343631623738656561323139633138333434373063656166
|
||||
31393735666232646536636131366137323432366530386135333530303734313539623465343739
|
||||
36343865663535336230343830343864623462376631626466613966346137633966333863623262
|
||||
33653739616261616136376533336135353635333839373438316364383131326434366534353532
|
||||
63316165623230623738633664633764613133633730383337336233616364356637313062343064
|
||||
65613232363331356139316161633639383963353666633430633635373033306532386236313665
|
||||
37323533383265373162313662656430623233613936353832653634303835656662373937633361
|
||||
63613866356663383939393434326530643234366462316230666134363530646631326465393865
|
||||
36633035323030663765626332363633626265633738353139663434356663303136643232633238
|
||||
65366335383961653865653636383036346135643064343765333863376666326135303233373163
|
||||
39653463386133326664363031396264363866303337323438616339393461393366643362393238
|
||||
62303735353738383135303939363437333062343437343030663265313632306132303461323431
|
||||
35356261333265313562373939616536383162363666666666326131306165343037313530393565
|
||||
61346430613064656231373161396163626461333830636338303232386537616363336361363763
|
||||
62613530343339336662326630633337336635643865663536323936316638313031343734326364
|
||||
34636130356335626662656462343238626564316131333566346661383438393830386162633765
|
||||
63393838616466353335646639366164666135646563383861383833623637303461643265666266
|
||||
63353233373936636565653539666264656438633330646665613266643064386437313362356236
|
||||
64613362653638306635393166356439656239303861666633616262396437353364383237333764
|
||||
65316465326536346636643836386363383365663765366431393031616134656438326436393636
|
||||
31663466633537393337386363353938303131373531376364656535356166646439653665366138
|
||||
36356339313739636431613730373931646264633461363735336534396264313363633864613464
|
||||
39383835636234386662303339303937383339323834383534633136316666383966343238303137
|
||||
39633536653035376335666265663731646164633835386666313361366231383933656332386639
|
||||
39353432326137663430643066666639636530353038326632333861653063326561396230323336
|
||||
36633766326364636131316333623461333436383561386231323565333431336266626230393536
|
||||
65353736366533663132376636323133386563636637386431323332373838663339346566663536
|
||||
38373964316537343263353338346438303733333062626232366139316162326434656462616437
|
||||
62323532383036343839396431366566323338383534343862343932333361343066653261633935
|
||||
30666634333161376432323266316339303062636562326638376166613862346465343663663365
|
||||
35336366313861626264383635613261663332356534343036666232386635363363623062323138
|
||||
34363038666564333565616261333532346663376263313630303934616331383761323037353066
|
||||
32656230393361373837346632656432306134333536326330663832633535373830653265633533
|
||||
37613137633634616639396666396430363831303463653238333163343433646639653436376233
|
||||
39623937653539653532393134333930303866626464303236653337393865313338356234363235
|
||||
34373962636239626533383062306638386333313166633439396630393233326461396464363135
|
||||
36633934333765653135633032656138333939323931666131623261626331633339353838346566
|
||||
39633238336337623936623639353465626437356630613436383536373137396465363765343634
|
||||
30326362613334323538323432643738303961626331623665306533386235646532313661396362
|
||||
62343136313836636335343565633537643563376463633565633834323861356637356261646436
|
||||
61353461623531653066363835353531373731356263306136646463653336313238623430333565
|
||||
30386338333335363530343535383965633161373465653231646565393930646436313438333535
|
||||
65643131636264303566613263346332636531626461353733353863313663316236366662303966
|
||||
61643736666631323465656562633637323061346539363938666663376363366561306166646565
|
||||
65633234356430643233313434663537623937323137623561363836313738353766653064383564
|
||||
39666563613638346136306433396631643762633630316164393131393264383965343439326436
|
||||
35313436363039663734
|
||||
34663634383639303339616335613031386632636130396636386237353764306265363731643735
|
||||
6634313030343637383763356639386636346262303331610a326438396239623766643139623238
|
||||
33333965373438373065653735323635646262306239663339363334393462633934323364356365
|
||||
3465336532386362370a386533346134353362623631363364313036353161663666393833663836
|
||||
32303631616331363031366131613566363633646465393965343239656662613764646235386431
|
||||
63653134343132383661373534363037666538353639613139633064636237303637623338623235
|
||||
39373966303632323061663966626262396337623465393330396431363936636366633134363535
|
||||
33353161333337653630363432323438313061346161643130363136346630306230656133643931
|
||||
30356665373662663832313963393861353331656564653661313165313039326432633662313363
|
||||
63393466326433666531313265373264613338373335396536363263356164666438616131623466
|
||||
34653761663836393936303733313162646234623066373039363630336633656636336636623830
|
||||
36333265333162646630396265346537356530386134343434343139326362363061633731646464
|
||||
34333934363436363662613938373437386335323538616436636533333837366333366636383635
|
||||
33393265643931373865316135373334336163343638326566356339663035326566393039313230
|
||||
32333864643434326161666162313532323161326263666639303738313431363536323633383030
|
||||
33353631326633656464626139393363346163663861616634353530663236383530356565616236
|
||||
66376364313266613535393333333435633233313363333135393662336333363034316161333438
|
||||
39313863353436323331663734653564333162363231373635366636653862313062643433356366
|
||||
37656230366232646463323965306139353634666335356466626466383931303735306435366237
|
||||
37623863376364653038346565313635646565303065303038653431643333613739663731626266
|
||||
65626533386563333434306637343864356465393537373738633335626434646362383863663737
|
||||
32666263373435323635313030663330653238616262323236636331343966356135656133373333
|
||||
33623765306434336133353831353430303236386536333431363239663466323565653961356531
|
||||
34383437623532336334343636343031346661383033323234356532393461393431383839366634
|
||||
63303865373436366136346266303632623932343232333237366430666236623137343834626534
|
||||
37303833363564623761353265626465366662306366366163333662396532306437333164353233
|
||||
37386432373965363864353438316161383930643934396132643766353139393039386538353964
|
||||
65346265666237393464336464663130393230643533353733326230333435623333333135626661
|
||||
38393531363634313036363035626134346434653263616639366165633032316137393861653037
|
||||
61396537396263393366336164346234346262303133343137373737633861316333663164306161
|
||||
63383832666630313238323161376665643939313737303563393337353031353939343235306635
|
||||
66646664363235346630663065313137303436663164656137393065383561353539663435303730
|
||||
34623233636230623965373933303966336537323466663330336261373734613838376634336130
|
||||
35653837386234666139393638653062636131323737376434623234353462383561323464343931
|
||||
65393438303561633530623731626338633333373436303431363038383363636466363738616534
|
||||
66323332346639323864356530336261666131306166353863636466613231303566393537353061
|
||||
61383666653762366361333336363465643633353235326163313364386562633366366634633565
|
||||
32386538393539656638363932366630303635663635656464316638666365353832393334393466
|
||||
38313866346139633031343331303836396231633335333664356230303738326662353432636538
|
||||
31616462313034633238323536333966373033393038653439326630386465613632326430366266
|
||||
65343934633865623838643466656563373234313534303033306339616561643761663362353232
|
||||
38386130386330366364656264393739376638393132343439306665303666363863313436393734
|
||||
62323238636434383166636133386362656463383337373765616564346130303765376635653737
|
||||
63376433336365646637313732336337666466393966366434643333653466616161373963343338
|
||||
30333261326331326230363535626632333231323037653738373635646666363964663239613535
|
||||
35346530663262303863626135303763363035373666653662303438326364336332386561313238
|
||||
32623834366233663161656363663065353636656435636132396631356361646465646332323965
|
||||
31376264626431393037366466656161636563356130373065353335306335323131346232323062
|
||||
63633033393430386265306661346231306331323239356232383237663835663637643539323534
|
||||
30323833376438346364313934346564623666653166373566616264373333636535633463623161
|
||||
66366633343038366132333362643363326537623161303163646535623832646337363436356135
|
||||
36616237653630366339326330316237316531393261393161313664363761613837376664393437
|
||||
64643965653562646635643862353230376262386231326633383739326334656262383062666561
|
||||
61313038336133343066336266353730643939653039363062633633343533396662663234303837
|
||||
66623164326636636239613938656565316363633033306431656363353637643833373761383134
|
||||
63313031643837653339633534356235656439356430343235636333343933316339323464396333
|
||||
61626464363564663136306131616633396266333737353537393564626630636364666132343437
|
||||
63633861386339373466343934343336663530303134653532373063376231636161626163336330
|
||||
31666537396265656164623239373932656165316237616561393437346266373034663231316634
|
||||
37323964656563653735363138353838313438303066366637313663643262316234326364306533
|
||||
33623335346235613733396562386365616239306333303962643333393931313162306665383935
|
||||
39313266313239623432613737663963353730646139643330623235333932623663636330386365
|
||||
62366533653535373764343032613035363931363732356430303364643133303763626436383265
|
||||
31356130303661646638303839666537373439383934363932383166306337336138323239643933
|
||||
63633535633861656632613238393032653936623238336361393237353764333634373039616331
|
||||
33353866363437323362346163363432356333336662643963353535316462623932343733613331
|
||||
35383138323462336537333937663461336339373832343032626539626238363635633331376232
|
||||
31613336363439343566626231613332323631323661626162326631383063336636663530666435
|
||||
39363961353334313861656634383038306639346564656464393064623061663835353862373265
|
||||
30663431363135326439303161313135363066356534393238626436336437363738633563303665
|
||||
66366162373037306338616365636435346362376438636164356336373735346664363334663761
|
||||
65653638626239363230373563313831343231303361343431666462636162386534626139303035
|
||||
33623138646630353133363966666466393734383939663536616133393863653862663264613534
|
||||
38313836306230353231633365666332633063633630623430313439613531376265366664396533
|
||||
35613861626130666666373062373566376665633230353738353535623733383264303939343430
|
||||
64613034343265656135376537313631383865316138303137643033656565646336363130313638
|
||||
30356339386137333035386662613461333132666535316530386239643633653436353665313066
|
||||
61346661353365616231663263396364393264303162346333623565613231653733343765653639
|
||||
33643839343235623134343465643631393833303361633234613561383937306530373061343566
|
||||
35373334333330313032393762383435663238326565613364643235656463386564303438613037
|
||||
39626233396338316564656165306433363161653562363863653038623636656165616361303837
|
||||
38633563306465373935363165363762633934336233643065666630643931646233393437363033
|
||||
38363766313862616533363661353165306264613739626264663334343966346361393866333533
|
||||
61303133313166643833653065366232383566643963653034313963303362356636316565363037
|
||||
36643564363936623166326533306263636264663535653733383331386530353236313031666264
|
||||
38376634383338646165373665643638393764346566646363366332386234643836353735313230
|
||||
37613062663636383831663866613664316631373762393231356239626666383333613630373634
|
||||
38303831613265626530623433323433333066333636376534396337383134333565646566356436
|
||||
31643737636665346462613464646232663864653431643065353732376136646430353330306434
|
||||
61653933303436643037316138323032323436316332376463323632326435623533373665326362
|
||||
64353931336239653563623162386463303037303031646536373662323337636364343133616537
|
||||
31303633306165623362653531623366613063376633613263343939326463396435303236643831
|
||||
65383234306165373438656435633535363533373438653361303739363735343464353435626136
|
||||
37613139636365623934393931353431316464343861366561323232323132393431626664363533
|
||||
32336566616366653163383162313062633730636463336339376230613932386232353961386165
|
||||
33643631303562663331613961373164303266613630303138633262373961313739326563356430
|
||||
32336637343639393465303731646431306363333638366162386665366238396565366364636237
|
||||
30393034663061346561396136646336393339343931623233393332623264323533356332613139
|
||||
64333933646138313232306536643263316261636630313035343730373038663564363236666435
|
||||
66336463316133633739343932353833623233306330393931663062343637326662326531663265
|
||||
39336530316431356364626431346430646361313635306132333930356230333634653062346234
|
||||
34306135653565613465646263303039393036623363383435656535646639333263623063666335
|
||||
37663365663331633538636633343532396236333139376534653833366563643564616633323636
|
||||
33323832643936633262313865623336346530313137643166613731323161343334666465653730
|
||||
32336531393034323236303239333235376532396562613531363639396534356239633334656263
|
||||
36353765366236383930383161366164373335396432393937623537306335613063303332343834
|
||||
62333130656661326433323830313837353833626665656238323736373163323930363065396339
|
||||
39396434326331636234646466323134396261366465643139306262613163653162353262633935
|
||||
31633865666532626264306130643866623735643637363666626164623833353136316132326532
|
||||
37363133643230343236613334316534393931353737303930666566653632386366643535663630
|
||||
64333362376463346462356564343038646638306432343965653035636632336438323764393165
|
||||
65376562623931626432363031306636333033663163336536316564663663383133356635613931
|
||||
33346262326631343338346365623266616134653161633166666538623233633134306337326664
|
||||
61663632353636646530326466353537656238306566386266663831333630396134333232356231
|
||||
39623434383038356265613861646539316538313566333966616362316364633262626634373334
|
||||
61643264393738616234373966666339333563306666316264393237373137393165656466386430
|
||||
35356331626465396435356139646464376161323939363631316630336364623935343330336266
|
||||
63616334353338613135326439326136396262623463333332643237613831636435613631316234
|
||||
35396264346536663162326531306137623532623734313133313034306231386466356164373962
|
||||
37663763313662383539343965376537303561643833306364626330343330613233356637393432
|
||||
34323235613661343565383238323566643831343963373835613336323864343230383331336339
|
||||
30383937636434643663366432386636303262623963623837356536303063393932363163626330
|
||||
63343031373739396162336238643331643261396637653137633138343937343562396164306331
|
||||
61643539336437646632353637643337626361636639616262373262306139323631633938353966
|
||||
36303835306637653038373439393139356537373830376665393536656165313864363538623366
|
||||
61333734336532306661326265333866303838653633313965336461663062306332353530346538
|
||||
30396538323732313238323063323239393530636664356166313231313961646536306662336237
|
||||
32393838656364636666646436303539623938393033663139643835646435313238366538316635
|
||||
31623333663962383335393834313237353466656535363537666137346562653238313265633734
|
||||
31366636663366616134653038353438383264313132633934336432316130356264366335653632
|
||||
64333431663130623464363039353532396661336362623365353762616539306637316664323238
|
||||
38363363333130623938623763323461626438323065383363616438653532396163333861636132
|
||||
39643762336163653764356632326631336332353763356332633931646130663961613461326239
|
||||
62346665313135646339313634353835353161373363643533376538393333393533663932303262
|
||||
38666238663832616637303261633462653332346237326662656232353034653163346463346636
|
||||
32636638633332336637366631626533383361366239613730626339313530306361303336383561
|
||||
37616234633762303938323032306337316334386130383033346263383365636232656330653939
|
||||
66353331313161316634363833373166313138396266313061616331353862363334353139383765
|
||||
33613335633331626530343637303535313035373362326661623432663262363034356461643931
|
||||
36653961303366366136313365666663373761343837626632656134666237613361376535323935
|
||||
64356332396461313765343332323166393235316239663163643864386337383963396332383863
|
||||
34366334303231643963653935386565373931616435363165313165636464656165363234643363
|
||||
63646531363464363634336230653261313061303934626631623738363266363432643630313762
|
||||
32326439346137616362386639653130646665333635356461643763373461316331626563383634
|
||||
62383964353661316438636635636639376265616336323764646130643037326138393034303837
|
||||
63643366393437303036326131646536333035326631383765643738663535373036316239636534
|
||||
65353161373962376663333231326636363638336666633130343766633861653266333765313566
|
||||
32636231383962396135323961643933303536306237396638623239366137313364646162663733
|
||||
31333061393561656432343263383066383234633731333465313632373333626463663733656166
|
||||
62326262393064653166626137303730613931613639313534633130636338326236646266393132
|
||||
64353463653333393062333663316238306331643662656638663563646234613164386635353039
|
||||
61383130386530656635313361613031373732633736653664396335636531363634373433363566
|
||||
64353730323838616463313565623330343962356436643231636264656639623261653530336235
|
||||
65643939396431383963326332663164663337623837333733656365343635643431643132376236
|
||||
39396337343466313839363635373561333864653661386632626634303066656232623065623635
|
||||
39653461643035623932643165383661383531336331653063346661343839343639376435353439
|
||||
35646362653033323739646165306365363039353038666634666665626365306165303062376663
|
||||
30646262343831326464623461323335663335663337323661373130386531396162646438643165
|
||||
62303365373736373539633637393730623339396435343166353164396230346263343764393561
|
||||
66613436363266366565656530336339356365393761313666393930353637383930376437626663
|
||||
61376262363437336436316462643331336631373734336334623033613936653061653361343962
|
||||
30613562366463363936656131363231343136623962373036376439353064643737653362323337
|
||||
34356433333030323363333837363036306436623534646231306134383430313766626435323165
|
||||
34613532666530306535323465383839613933303130636436653339396538623366393162373532
|
||||
34333130663062316137306639633436373061326139323164303335653635663134653331306534
|
||||
30373535316331336434363231363839643862373139393234373338313832386164326466343661
|
||||
62656666396363333233383137333438626365306330383431623564333461663534653739376435
|
||||
66393565333936323339346438636330323866653739613562313733366138316439336164643939
|
||||
31383161633734333539663938353337633362653262613537373236386566343861336566343239
|
||||
62343264373865383834363861323032383339363838376232303863363966643136653937613930
|
||||
35393633633339333064303234343138663137336338626164363664316432333363303235333033
|
||||
31633364383664633166303830666434613130333764356166333761346131313135306462653065
|
||||
63616437643032613435343832643132356439626534616630613538373862396162356332376539
|
||||
35656362386530613838636237623833666632626461333237313032633837646364386130623964
|
||||
38653762393938393339373737613631356436623331323265383334373965383636326365363739
|
||||
63636337656562346532313061616533333930336339363764346231373430343133376465616433
|
||||
30666362393734333639376536326432386364363235373938343037626662626438313430386362
|
||||
6362383662633631323761623932636162363335373966343566
|
||||
|
|
|
|||
|
|
@ -28,4 +28,8 @@ icingaweb2_ido_db_password: "{{ vault_icingaweb2_ido_db_password }}"
|
|||
icinga2_iftraffic_snmp_community: "{{ vault_icinga2_iftraffic_snmp_community }}"
|
||||
icinga2_pagerduty_key: "{{ vault_icinga2_pagerduty_key }}"
|
||||
icinga2_pagerduty_servers_key: "{{ vault_icinga2_pagerduty_servers_key }}"
|
||||
|
||||
# incident.io alert integration
|
||||
icinga2_incidentio_endpoint_url: "https://api.incident.io/v2/alert_events/http/01KYB0N5Q9ZCB4FABJ4SX2C1Y2"
|
||||
icinga2_incidentio_token: "{{ vault_icinga2_incidentio_token }}"
|
||||
icingaweb2_admin_password_hash: "{{ vault_icingaweb2_admin_password_hash | default('') }}"
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ icinga2_ticket_salt: "" # only needed for distributed setups
|
|||
icinga2_pagerduty_key: "..."
|
||||
icinga2_pagerduty_servers_key: "..."
|
||||
|
||||
# incident.io alert integration token (Bearer token for the HTTP alert source)
|
||||
icinga2_incidentio_token: "..."
|
||||
|
||||
# icingaweb2 admin user (web UI password). Generate the hash on any host
|
||||
# with PHP installed: php -r 'echo password_hash("plaintext", PASSWORD_DEFAULT);'
|
||||
icingaweb2_admin_password_hash: "$2y$10$..."
|
||||
|
|
|
|||
|
|
@ -0,0 +1,92 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# incident.io alert notification script for Icinga2
|
||||
#
|
||||
# Sends host/service alerts to incident.io via their HTTP alert source API.
|
||||
#
|
||||
# Usage (called by Icinga2 NotificationCommand):
|
||||
# incidentio-notification.sh \
|
||||
# --endpoint-url <url> \
|
||||
# --token <bearer-token> \
|
||||
# --title <alert-title> \
|
||||
# --description <alert-description> \
|
||||
# --dedup-key <deduplication-key> \
|
||||
# --status <icinga-notification-type> \
|
||||
# [--host <hostname>] \
|
||||
# [--service <servicename>]
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ENDPOINT_URL=""
|
||||
TOKEN=""
|
||||
TITLE=""
|
||||
DESCRIPTION=""
|
||||
DEDUP_KEY=""
|
||||
NOTIF_STATUS=""
|
||||
HOST=""
|
||||
SERVICE=""
|
||||
METADATA="{}"
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--endpoint-url) shift; ENDPOINT_URL="$1" ;;
|
||||
--token) shift; TOKEN="$1" ;;
|
||||
--title) shift; TITLE="$1" ;;
|
||||
--description) shift; DESCRIPTION="$1" ;;
|
||||
--dedup-key) shift; DEDUP_KEY="$1" ;;
|
||||
--status) shift; NOTIF_STATUS="$1" ;;
|
||||
--host) shift; HOST="$1" ;;
|
||||
--service) shift; SERVICE="$1" ;;
|
||||
*) echo "Unknown argument: $1" >&2; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# Validate required fields
|
||||
if [ -z "$ENDPOINT_URL" ] || [ -z "$TOKEN" ] || [ -z "$TITLE" ] || [ -z "$DEDUP_KEY" ] || [ -z "$NOTIF_STATUS" ]; then
|
||||
echo "Missing required arguments" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Map Icinga2 notification type to incident.io status
|
||||
case "$NOTIF_STATUS" in
|
||||
PROBLEM|DOWN|CRITICAL|WARNING|UNKNOWN)
|
||||
INCIDENT_STATUS="firing"
|
||||
;;
|
||||
RECOVERY|UP|OK)
|
||||
INCIDENT_STATUS="resolved"
|
||||
;;
|
||||
ACKNOWLEDGEMENT)
|
||||
INCIDENT_STATUS="firing"
|
||||
METADATA="$(echo "$METADATA" | jq -c '.acknowledged = true')"
|
||||
;;
|
||||
*)
|
||||
# Default to firing for anything unrecognised
|
||||
INCIDENT_STATUS="firing"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Build metadata with host/service info
|
||||
if [ -n "$HOST" ]; then
|
||||
METADATA="$(echo "$METADATA" | jq -c --arg h "$HOST" '.host = $h')"
|
||||
fi
|
||||
if [ -n "$SERVICE" ]; then
|
||||
METADATA="$(echo "$METADATA" | jq -c --arg s "$SERVICE" '.service = $s')"
|
||||
fi
|
||||
METADATA="$(echo "$METADATA" | jq -c --arg ns "$NOTIF_STATUS" '.icinga_notification_type = $ns')"
|
||||
|
||||
# Build JSON payload
|
||||
PAYLOAD=$(jq -c -n \
|
||||
--arg title "$TITLE" \
|
||||
--arg description "$DESCRIPTION" \
|
||||
--arg dedup_key "$DEDUP_KEY" \
|
||||
--arg status "$INCIDENT_STATUS" \
|
||||
--argjson metadata "$METADATA" \
|
||||
'{title: $title, description: $description, deduplication_key: $dedup_key, status: $status, metadata: $metadata}'
|
||||
)
|
||||
|
||||
# Send to incident.io
|
||||
curl -s -S -X POST "$ENDPOINT_URL" \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$PAYLOAD"
|
||||
|
|
@ -312,7 +312,7 @@
|
|||
mode: "0640"
|
||||
notify: Restart icinga2
|
||||
|
||||
- name: Render templated conf.d files (api-users + pagerduty)
|
||||
- name: Render templated conf.d files (api-users + pagerduty + incidentio)
|
||||
ansible.builtin.template:
|
||||
src: "icinga2/conf.d/{{ item }}.j2"
|
||||
dest: "/etc/icinga2/conf.d/{{ item }}"
|
||||
|
|
@ -323,6 +323,18 @@
|
|||
- api-users.conf
|
||||
- pagerduty-icinga2.conf
|
||||
- pagerduty-servers-icinga2.conf
|
||||
- incidentio-icinga2.conf
|
||||
notify: Restart icinga2
|
||||
|
||||
- name: Deploy Icinga2 notification scripts
|
||||
ansible.builtin.copy:
|
||||
src: "icinga2/scripts/{{ item }}"
|
||||
dest: "/etc/icinga2/scripts/{{ item }}"
|
||||
owner: nagios
|
||||
group: nagios
|
||||
mode: "0755"
|
||||
loop:
|
||||
- incidentio-notification.sh
|
||||
notify: Restart icinga2
|
||||
|
||||
# ----------- Icinga Web 2 config -----------
|
||||
|
|
|
|||
|
|
@ -0,0 +1,110 @@
|
|||
{% if icinga2_incidentio_token is defined and icinga2_incidentio_endpoint_url is defined %}
|
||||
|
||||
object User "incidentio" {
|
||||
display_name = "incident.io"
|
||||
groups = [ "icingaadmins" ]
|
||||
|
||||
vars.token = {{ icinga2_incidentio_token | to_json }}
|
||||
vars.endpoint_url = {{ icinga2_incidentio_endpoint_url | to_json }}
|
||||
|
||||
states = [ OK, Warning, Critical, Unknown, Up, Down ]
|
||||
types = [ Problem, Acknowledgement, Recovery ]
|
||||
}
|
||||
|
||||
object NotificationCommand "notify-service-by-incidentio" {
|
||||
import "plugin-notification-command"
|
||||
|
||||
command = [ ConfigDir + "/scripts/incidentio-notification.sh" ]
|
||||
|
||||
arguments = {
|
||||
"--endpoint-url" = {
|
||||
value = "$user.vars.endpoint_url$"
|
||||
order = 0
|
||||
}
|
||||
"--token" = {
|
||||
value = "$user.vars.token$"
|
||||
order = 1
|
||||
}
|
||||
"--title" = {
|
||||
value = "$service.name$ on $host.display_name$ is $service.state$"
|
||||
order = 2
|
||||
}
|
||||
"--description" = {
|
||||
value = "$service.output$"
|
||||
order = 3
|
||||
}
|
||||
"--dedup-key" = {
|
||||
value = "service-$host.name$-$service.name$"
|
||||
order = 4
|
||||
}
|
||||
"--status" = {
|
||||
value = "$notification.type$"
|
||||
order = 5
|
||||
}
|
||||
"--host" = {
|
||||
value = "$host.name$"
|
||||
order = 6
|
||||
}
|
||||
"--service" = {
|
||||
value = "$service.name$"
|
||||
order = 7
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object NotificationCommand "notify-host-by-incidentio" {
|
||||
import "plugin-notification-command"
|
||||
|
||||
command = [ ConfigDir + "/scripts/incidentio-notification.sh" ]
|
||||
|
||||
arguments = {
|
||||
"--endpoint-url" = {
|
||||
value = "$user.vars.endpoint_url$"
|
||||
order = 0
|
||||
}
|
||||
"--token" = {
|
||||
value = "$user.vars.token$"
|
||||
order = 1
|
||||
}
|
||||
"--title" = {
|
||||
value = "Host $host.display_name$ is $host.state$"
|
||||
order = 2
|
||||
}
|
||||
"--description" = {
|
||||
value = "$host.output$"
|
||||
order = 3
|
||||
}
|
||||
"--dedup-key" = {
|
||||
value = "host-$host.name$"
|
||||
order = 4
|
||||
}
|
||||
"--status" = {
|
||||
value = "$notification.type$"
|
||||
order = 5
|
||||
}
|
||||
"--host" = {
|
||||
value = "$host.name$"
|
||||
order = 6
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apply Notification "incidentio-service" to Service {
|
||||
command = "notify-service-by-incidentio"
|
||||
states = [ OK, Warning, Critical, Unknown ]
|
||||
types = [ Problem, Acknowledgement, Recovery ]
|
||||
period = "24x7"
|
||||
users = [ "incidentio" ]
|
||||
assign where service.vars.enable_incidentio == true
|
||||
}
|
||||
|
||||
apply Notification "incidentio-host" to Host {
|
||||
command = "notify-host-by-incidentio"
|
||||
states = [ Up, Down ]
|
||||
types = [ Problem, Acknowledgement, Recovery ]
|
||||
period = "24x7"
|
||||
users = [ "incidentio" ]
|
||||
assign where host.vars.enable_incidentio == true
|
||||
}
|
||||
|
||||
{% endif %}
|
||||
Loading…
Add table
Reference in a new issue