mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added log events for jira transport (#7059)
* Added log events for jira transport * Resolve jira ticket bug for normal alerts
This commit is contained in:
committed by
Neil Lathwood
parent
ac5b2c663c
commit
a2a1174033
@@ -22,10 +22,11 @@
|
||||
*/
|
||||
|
||||
// Don't create tickets for resolutions
|
||||
if($obj['status'] == 0 && $obj['msg'] != 'This is a test alert') {
|
||||
if($obj['severity'] == 'recovery' && $obj['msg'] != 'This is a test alert') {
|
||||
return True;
|
||||
}
|
||||
|
||||
$device = device_by_id_cache($obj['device_id']); // for event logging
|
||||
|
||||
$username = $opts['username'];
|
||||
$password = $opts['password'];
|
||||
@@ -58,7 +59,10 @@ curl_setopt($curl, CURLOPT_POSTFIELDS, $datastring);
|
||||
$ret = curl_exec($curl);
|
||||
$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
if( $code == 200 ) {
|
||||
$jiraout = json_decode($ret, true);
|
||||
d_echo("Created jira issue ".$jiraout['key']." for ".$device);
|
||||
return true;
|
||||
} else {
|
||||
d_echo("Jira connection error: ".serialize($ret));
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user