etsy / opsweekly

On call alert classification and reporting
MIT License
761 stars 100 forks source link

Oncall provider:logstash integration with Icinga "help wanted" #44

Open gangsta opened 9 years ago

gangsta commented 9 years ago

Hi Did someone of you integrate opsweekly with icinga i did try with logstash oncall but i cant get icinga stuff in opsweekly . below you can find config file ,any ideas ?

<?php $mysql_host = "mysql"; $mysql_user = "opsweekly_user"; $mysql_pass = "mysql";

$email_from_domain = "email.eu";

function getUsername() { // Use the PHP_AUTH_USER header which contains the username when Basic auth is used. return $_NAME['PHP_AUTH_USER']; }

$teams = array( "ops.eu" => array( "root_url" => "", "display_name" => "ops", "email_report_to" => "email", "database" => "opsweekly", "weekly_hints" => array( "github"), "oncall" => array( "provider" => "logstash", "timezone" => "Europe/Brussels", "start" => "monday 08:00", "end" => "monday 08:00", ), ), );

$weekly_providers = array( "github" => array( "display_name" => "Github", "lib" => "providers/weekly/github.php", "class" => "GithubHints", "options" => array( "github_url" => "https://github.com/mycompany", ), ), );

$oncall_providers = array( "logstash" => array( "display_name" => "ops", "lib" => "providers/oncall/logstash.php", "options" => array( "base_url" => "logstash.mycompany:9200", ), ), );

$search_results_per_page = 25; $error_log_file = "/var/log/httpd/opsweekly_debug.log"; $dev_fqdn = "/(\w+).vms.mycompany.com/"; $prod_fqdn = "opsweekly.mycompany";

also please check if there is something missed with github, cause i cant get some things from github too. Greetings Karen

arioch commented 9 years ago

+1

benohara commented 9 years ago

Does icinga log with different variable to nagios?

The plugin does a query to logstash

"query": "nagios_notifyname:\"'.$pagername.'\" AND NOT (nagios_state:\"ACKNOWLEDGEMENT*\" OR nagios_state:\"UP\" OR nagios_state:\"OK\") AND NOT nagios_service:\"SMS Check\""

perhaps icinga_ ?

I wrote the plugin, its currently hardcoded... i'll make the query settable via config and submit a PR if it helps.

yosh-se commented 9 years ago

I setup logstash-forwarder on the icinga machine to shoot the icinga logs into logstash. I think the logstash nagios rules worked out of the box with that, but I'd need to revisit my setup to make sure.

I checked the nagios provider query, and I hadn't changed it.

How did you setup the logstash filter for the logs? pattern => "%{NAGIOSLOGLINE}" ?

As for the github stuff, does your icinga contact names match your users github names?