-
Integración con PagerDuty
Hola,
Estoy intentando integrar las alarmas de Pandora FMS con Pagerduty, siguiendo principalmente la documentación y scripts que hay en la librería https://pandorafms.com/library/pagerduty-integration-with-alerts/ y también la info que encontré en Pagerduty https://www.pagerduty.com/docs/guides/pandora-fms-integration-guide/
Pero no consigo registrar alarmas en PagerDuty ni con la v1 ni con la v2 de la API de PagerDuty.
Después de varias pruebas y ajustes, con la v1 no paso de aquí:
—
[root@s]# /usr/share/pandora_server/util/PandoraFMS_pagerduty_v1_v2.pl “1” “xxxxxxxxxxx” “33” “Trigger” “PandoraFMS Alert” “2020-02-21 14:50:38” “Critical” “Agent_1” “Ping” “0”
Use of uninitialized value $page_duty_id in concatenation (.) or string at /usr/share/pandora_server/util/PandoraFMS_pagerduty_v1_v2.pl line 157.
HTTP POST error code: 400
HTTP POST error message: Bad Request—
Y con la v2 de aquí:
—
[root@s]# /usr/share/pandora_server/util/PandoraFMS_pagerduty_v1_v2.pl “2” “aaaaaaaaaaaaaaaaaa” “PRAFOJZ” “xxx@xxxxxxxxx” “PandoraFMS Alert” “hola”ERROR
$VAR1 = bless( {
‘_msg’ => ‘Unauthorized’,
‘_content’ => ”,
‘_protocol’ => ‘HTTP/1.1’,
‘_headers’ => bless( {
‘connection’ => ‘close’,
‘cache-control’ => ‘no-cache’,
‘access-control-allow-origin’ => ‘*’,
‘date’ => ‘Wed, 08 Dec 2021 12:14:49 GMT’,
‘client-ssl-cert-issuer’ => ‘/C=US/O=DigiCert Inc/CN=DigiCert TLS RSA SHA256 2020 CA1’,
‘client-ssl-cipher’ => ‘ECDHE-RSA-AES128-GCM-SHA256’,
‘client-peer’ => ‘44.227.224.80:443’,
‘client-warning’ => ‘Missing Authenticate header’,
‘client-date’ => ‘Wed, 08 Dec 2021 13:14:30 GMT’,
‘client-ssl-warning’ => ‘Peer certificate not verified’,
‘content-type’ => ‘text/html’,
‘server’ => ‘nginx’,
‘client-ssl-socket-class’ => ‘IO::Socket::SSL’,
‘x-request-id’ => ‘c41baa04a20d5f565bb6c6aef94dc91d’,
‘client-response-num’ => 1,
‘content-length’ => ‘0’,
‘::std_case’ => {
‘client-response-num’ => ‘Client-Response-Num’,
‘access-control-allow-origin’ => ‘Access-Control-Allow-Origin’,
‘client-ssl-cert-issuer’ => ‘Client-SSL-Cert-Issuer’,
‘client-ssl-cipher’ => ‘Client-SSL-Cipher’,
‘client-peer’ => ‘Client-Peer’,
‘client-warning’ => ‘Client-Warning’,
‘client-date’ => ‘Client-Date’,
‘client-ssl-warning’ => ‘Client-SSL-Warning’,
‘client-ssl-cert-subject’ => ‘Client-SSL-Cert-Subject’,
‘x-request-id’ => ‘X-Request-Id’,
‘client-ssl-socket-class’ => ‘Client-SSL-Socket-Class’
},
‘client-ssl-cert-subject’ => ‘/C=US/ST=California/L=San Francisco/O=PagerDuty, Inc./CN=*.pagerduty.com’
}, ‘HTTP::Headers’ ),
‘_rc’ => 401,
‘_request’ => bless( {
‘_content’ => ‘{“incident”: {
“type”: “incident”,
“title”: “PandoraFMS Alert”,
“service”: {
“id”: “PRAFOJZ” ,
“type”: “service_reference”
},
“body”: {
“type”: “incident_body”,
“details”: “hola”
},
}
}’,
‘_uri’ => bless( do{(my $o = ‘https://api.pagerduty.com/incidents’)}, ‘URI::https’ ),
‘_headers’ => bless( {
‘user-agent’ => ‘libwww-perl/6.03’,
‘content-type’ => ‘application/json’,
‘accept’ => ‘application/vnd.pagerduty+json;version=2’,
‘from’ => ‘xxxxxx@xxxxxxxxxxxxx’,
‘::std_case’ => {
‘if-ssl-cert-subject’ => ‘If-SSL-Cert-Subject’
},
‘authorization’ => ‘Token token= aaaaaaaaaaaaaaaaaaaaa
}, ‘HTTP::Headers’ ),
‘_method’ => ‘POST’,
‘_uri_canonical’ => $VAR1->{‘_request’}{‘_uri’}
}, ‘HTTP::Request’ )
}, ‘HTTP::Response’ );Alguien ha conseguido registrar las alarmas de Pandora FMS en PagerDuty?
Muchas gracias.