I am trying to integrate the ELK stack into Icinga2. I have Icingaweb configured and I have enable the elasticsearch module. Later on I have added an instance using icingaweb and created and eventype.
When I am trying to execute the following command to check instance details, getting an error message UNKNOWN- instance not found.
icingacli elasticsearch --instance
Can anybody provide me suggestion on how to connect to ELK instance?
it’s long time ago when I tried this module. Maybe I remember some points which could help. But for this there would be interesting how you configured it:
Which OS? Maybe SELinux make some troubles if configured
I need your suggestion/assistance here to send the logstash logs to Icinga for monitoring purpose.
Let me explain you my environment and scenario.
I have ELK stack running on one server and have Filebaat is running other 3 servers. I am able to gather the logs on Kibana Dashboard using filebeat. Everything working fine so far.
Now I have send the logstash logs which I am getting through the filebeat. I have to configure the Iciniga2 on my ELK Stack.
I have installed and configure the Icinga2 and icingaweb on server where ELK stack is running.
Now I following the following link to use elasticsearch module to send the logstash data to Icinga.
What I did is I have enable the elasticsearch module on server and then from Icingaweb GUI I have configure the elasticsearch where I have created and instance and eventtype.
I have given the hostip:9200 as URI while creating and instance and elastic user and password which I use to loging to kibana dashboard. In Eventtype I have given index details and IP address of host where ELK stack running and field I have used @timestamp just for testing purpose.
When I checked in icinga I am unable to find anything related to Elasticsearch.
I can see the elasticsearch module is enable and when I try to run the following command I am getting an error instance not found
Thanks @stevie-sy for stepping in. That’s what I would have asked so far, too.
Hm… @sabil05 could you post the contents of /etc/icingaweb2/modules/elasticsearch/instances.ini? Please make very sure to remove any password and maybe even the hostname of your Elasticsearch instance?
Your command didn’t work for me, too because I named my instance Elasticsearch (it’s case sensitive…)
URI field is mandatory which creating an instance in icinga and I have updated my elasticsearch IP address with 9200 port. Elasticsearch is running as a container only host machine.
I tried removing the credentials from Instance.ini and was getting authorization error.
Now I have again update the credentials and now I am getting following error.
icingacli elasticsearch check --instance Elasticsearch --crit 5 --warn 3 --index filebeat-* --filter "beat.hostname=hostname AND severity=critical" --from -1h
UNKNOWN - count(): Parameter must be an array or an object that implements Countable
Now not getting instance not found error.
Note I have renamed instance from elasticsearch to Elasticsearch.