Comments (23)
Please provide a bit more info by answering as many of these questions as possible. https://github.com/alerta/alerta/wiki/Support-Request Thanks.
from docker-alerta.
I'm using Nagios 4.3.4 and alerta docker latest version
I followed the installation process configuring everything as provided in the github/alerta/nagios-alerta page, Nagios log show that the configuration has been run correctly. Alerta is not showing any kind of logs for this and Nagios show this as correctly, nothing else
from docker-alerta.
Can you run the Alerta NEB in debug mode and paste the output below? Thanks.
from docker-alerta.
Hi.
Nagios configuration was correctly set up:
#Alerta gateway
broker_module=/usr/lib/nagios/alerta-neb.o https://example.org:9002/api key=TOKEN env=Production debug=1
The module was loaded:
[1530711268] [alerta] Initialising Nagios-Alerta Gateway module, v4.0.0
[1530711268] [alerta] debug is on
[1530711268] [alerta] states=Hard/Soft
[1530711268] [alerta] Forward service checks, host checks and downtime to https://example.org:9002/api
[1530711268] Event broker module '/usr/lib/nagios/alerta-neb.o' initialized successfully.
localhost.cfg
define host{
use generic-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name localhost
alias localhost
address 127.0.0.1
_Environment Production
_Service Nagios
}
define service{
use generic-service ; Name of service template to use
host_name localhost
service_description Root Partition
check_command check_nrpe_arg!check_local_disk!91%!2%!91%!92%
_Service System
}
define service{
use generic-service
host_name localhost
service_description Memory Usage
check_command check_nrpe_arg!check_mem!1%!2%
check_interval 5
_Service System
}
What could be the issue?
from docker-alerta.
Can you query this URL and get a valid API response? https://example.org:9002/api
from docker-alerta.
When I curl the URL:
curl -k https://example.org:9002/api
{
"code": 500,
"errors": [
"Traceback (most recent call last):\n File \"/venv/lib/python3.6/site-packages/werkzeug/routing.py\", line 1538, in match\n rv = rule.match(path, method)\n File \"/venv/lib/python3.6/site-packages/werkzeug/routing.py\", line 776, in match\n raise RequestSlash()\nwerkzeug.routing.RequestSlash\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/venv/lib/python3.6/site-packages/flask/app.py\", line 1813, in full_dispatch_request\n rv = self.dispatch_request()\n File \"/venv/lib/python3.6/site-packages/flask/app.py\", line 1791, in dispatch_request\n self.raise_routing_exception(req)\n File \"/venv/lib/python3.6/site-packages/flask/app.py\", line 1774, in raise_routing_exception\n raise request.routing_exception\n File \"/venv/lib/python3.6/site-packages/flask/ctx.py\", line 336, in match_request\n self.url_adapter.match(return_rule=True)\n File \"/venv/lib/python3.6/site-packages/werkzeug/routing.py\", line 1542, in match\n safe='/:|+') + '/', query_args))\nwerkzeug.routing.RequestRedirect: 301 Moved Permanently: None\n"
],
"message": "301 Moved Permanently: None",
"status": "error"
}
from docker-alerta.
Can you answer these questions? It will save a lot of back and forth.
server version? client version?
python version? 2 or 3?
deployment method? pypi, docker, heroku, other?
operating system and version? linux (ubuntu/debian, redhat/fedora, other), macos, windows
mongodb or postgres backend? versions?
web ui version? latest master?
is auth enabled? basic or oauth2 provider?
is customer views enabled? how many customers (0,1,>1)?
from docker-alerta.
Alerta version: 5.2.4
Python version: 3.6
deploy method: docker
Backend: Postgres 10.4
web ui version: 5.2.4
Auth: Basic LDAP
Nagios version: 4.3.4
from docker-alerta.
what do you get if you curl https://example.org:9002/api/
or https://example.org:9002/api/_
?
from docker-alerta.
https://example.org:9002/api/_ returns OK
https://example.org:9002/api/ returns bunch of POST and GET methods to different hrefs
from docker-alerta.
So it seems to me that everything is working. I suggest you configure the heartbeats and see if they work, if not you will need to capture the debug output in the nagios logs generated by the Alerta NEB otherwise I've got nothing to work with. If you can't get any log output you're going to have to snoop the TCP traffic to see what's happening to the HTTP requests between Nagios and Alerta. Let me know how you get on. https://github.com/alerta/nagios-alerta#heartbeats
from docker-alerta.
I still have no logs from this, I made the alerta cli work with the API, but nagios still not working as specified before we are using this conf:
broker_module=/usr/lib/nagios/alerta-neb.o https://example.org:9002/api sslverify=off env=Production debug=1
Is this correct and enough for nagios?
from docker-alerta.
This is what I have configured for my test nagios 4 server...
$ vi /usr/local/nagios/etc/nagios.cfg
broker_module=/usr/lib/nagios/alerta-neb.o http://localhost:8080 debug=1
And it generates a lot of debug output to /usr/local/nagios/var/nagios.log
...
[1530818800] Nagios 4.1.1 starting... (PID=7035)
[1530818800] Local time is Thu Jul 05 19:26:40 UTC 2018
[1530818800] LOG VERSION: 2.0
[1530818800] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1530818800] qh: core query handler registered
[1530818800] nerd: Channel hostchecks registered successfully
[1530818800] nerd: Channel servicechecks registered successfully
[1530818800] nerd: Channel opathchecks registered successfully
[1530818800] nerd: Fully initialized and ready to rock!
[1530818800] wproc: Successfully registered manager as @wproc with query handler
[1530818800] wproc: Registry request: name=Core Worker 7039;pid=7039
[1530818800] wproc: Registry request: name=Core Worker 7040;pid=7040
[1530818800] wproc: Registry request: name=Core Worker 7038;pid=7038
[1530818800] wproc: Registry request: name=Core Worker 7037;pid=7037
[1530818800] Error: Could not load module '/usr/lib/nagios/alerta-neb.o' -> /usr/lib/nagios/alerta-neb.o: cannot open shared object file: No such file or directory
[1530818800] Error: Failed to load module '/usr/lib/nagios/alerta-neb.o'.
[1530818800] Error: Module loading failed. Aborting.
[1530819409] Nagios 4.1.1 starting... (PID=7367)
[1530819409] Local time is Thu Jul 05 19:36:49 UTC 2018
[1530819409] LOG VERSION: 2.0
[1530819409] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1530819409] qh: core query handler registered
[1530819409] nerd: Channel hostchecks registered successfully
[1530819409] nerd: Channel servicechecks registered successfully
[1530819409] nerd: Channel opathchecks registered successfully
[1530819409] nerd: Fully initialized and ready to rock!
[1530819409] wproc: Successfully registered manager as @wproc with query handler
[1530819409] wproc: Registry request: name=Core Worker 7369;pid=7369
[1530819409] wproc: Registry request: name=Core Worker 7372;pid=7372
[1530819409] wproc: Registry request: name=Core Worker 7371;pid=7371
[1530819409] wproc: Registry request: name=Core Worker 7370;pid=7370
[1530819409] [alerta] Initialising Nagios-Alerta Gateway module, v4.0.0
[1530819409] [alerta] debug is on
[1530819409] [alerta] states=Hard/Soft
[1530819409] [alerta] Forward service checks, host checks and downtime to http://localhost:8080
[1530819409] Event broker module '/usr/lib/nagios/alerta-neb.o' initialized successfully.
[1530819410] Successfully launched command file worker with pid 7373
[1530819414] [alerta] Host check received.
[1530819414] {"origin": "nagios/ubuntu-xenial", "resource": "localhost", "tags": ["check=Active"], "customer": "", "event": "Host Check", "text": "PING OK - Packet loss = 0%, RTA = 0.07 ms", "service": ["Platform"], "group": "Nagios", "environment": "Production", "severity": "normal", "value": "1/10 (Hard)", "type": "nagiosHostAlert", "rawData": "rta=0.069000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0"}
[1530819414] [curl] Trying 127.0.0.1...
[1530819414] [curl] Connected to localhost (127.0.0.1) port 8080 (#0)
[1530819414] [curl] POST /alert HTTP/1.1^M
Host: localhost:8080^M
User-Agent: Nagios-Alerta Gateway/4.0.0^M
Accept: */*^M
Content-Type: application/json^M
Content-Length: 400^M
^M
{"origin": "nagios/ubuntu-xenial", "resource": "localhost", "tags": ["check=Active"], "customer": "", "event": "Host Check", "text": "PING OK - Packet loss = 0%, RTA = 0.07 ms", "service": ["Platform"], "group": "Nagios", "environment": "Production", "severity": "normal", "value": "1/10 (Hard)", "type": "nagiosHostAlert", "rawData": "rta=0.069000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0"}
[1530819414] [curl] {"origin": "nagios/ubuntu-xenial", "resource": "localhost", "tags": ["check=Active"], "customer": "", "event": "Host Check", "text": "PING OK - Packet loss = 0%, RTA = 0.07 ms", "service": ["Platform"], "group": "Nagios", "environment": "Production", "severity": "normal", "value": "1/10 (Hard)", "type": "nagiosHostAlert", "rawData": "rta=0.069000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0"}
[1530819414] [curl] upload completely sent off: 400 out of 400 bytes
[1530819414] [curl] HTTP/1.1 201 CREATED
[1530819414] [curl] Date: Thu, 05 Jul 2018 19:36:54 GMT
[1530819414] [curl] Server: Apache/2.4.18 (Ubuntu)
[1530819414] [curl] Access-Control-Allow-Origin: http://localhost
[1530819414] [curl] Vary: Origin
[1530819414] [curl] Content-Length: 1521
[1530819414] [curl] Content-Type: application/json
[1530819414] [curl] ^M
{"alert":{"attributes":{"ip":"127.0.0.1"},"correlate":[],"createTime":"2018-07-05T19:36:54.983Z","customer":null,"duplicateCount":0,"environment":"Production","event":"Host Check","group":"Nagios","history":[{"event":"Host Check","href":"http://localhost:8080/alert/8e3450ae-77dc-471b-8241-2643814e6648","id":"8e3450ae-77dc-471b-8241-2643814e6648","severity":"normal","status":null,"text":"PING OK - Packet loss = 0%, RTA = 0.07 ms","type":"severity","updateTime":"2018-07-05T19:36:54.983Z","value":"1/10 (Hard)"},{"event":"Host Check","href":"http://localhost:8080/alert/8e3450ae-77dc-471b-8241-2643814e6648","id":"8e3450ae-77dc-471b-8241-2643814e6648","severity":null,"status":"closed","text":"new alert status change","type":"status","updateTime":"2018-07-05T19:36:54.985Z","value":null}],"href":"http://localhost:8080/alert/8e3450ae-77dc-471b-8241-2643814e6648","id":"8e3450ae-77dc-471b-8241-2643814e6648","lastReceiveId":"8e3450ae-77dc-471b-8241-2643814e6648","lastReceiveTime":"2018-07-05T19:36:54.985Z","origin":"nagios/ubuntu-xenial","previousSeverity":"indeterminate","rawData":"rta=0.069000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0","receiveTime":"2018-07-05T19:36:54.985Z","repeat":false,"resource":"localhost","service":["Platform"],"severity":"normal","status":"closed","tags":["check=Active"],"text":"PING OK - Packet loss = 0%, RTA = 0.07 ms","timeout":86400,"trendIndication":"lessSevere","type":"nagiosHostAlert","value":"1/10 (Hard)"},"id":"8e3450ae-77dc-471b-8241-2643814e6648","status":"ok"}
[1530819414] [curl] {"alert":{"attributes":{"ip":"127.0.0.1"},"correlate":[],"createTime":"2018-07-05T19:36:54.983Z","customer":null,"duplicateCount":0,"environment":"Production","event":"Host Check","group":"Nagios","history":[{"event":"Host Check","href":"http://localhost:8080/alert/8e3450ae-77dc-471b-8241-2643814e6648","id":"8e3450ae-77dc-471b-8241-2643814e6648","severity":"normal","status":null,"text":"PING OK - Packet loss = 0%, RTA = 0.07 ms","type":"severity","updateTime":"2018-07-05T19:36:54.983Z","value":"1/10 (Hard)"},{"event":"Host Check","href":"http://localhost:8080/alert/8e3450ae-77dc-471b-8241-2643814e6648","id":"8e3450ae-77dc-471b-8241-2643814e6648","severity":null,"status":"closed","text":"new alert status change","type":"status","updateTime":"2018-07-05T19:36:54.985Z","value":null}],"href":"http://localhost:8080/alert/8e3450ae-77dc-471b-8241-2643814e6648","id":"8e3450ae-77dc-471b-8241-2643814e6648","lastReceiveId":"8e3450ae-77dc-471b-8241-2643814e6648","lastReceiveTime":"2018-07-05T19:36:54.985Z","origin":"nagios/ubuntu-xenial","previousSeverity":"indeterminate","rawData":"rta=0.069000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0","receiveTime":"2018-07-05T19:36:54.985Z","repeat":false,"resource":"localhost","service":["Platform"],"severity":"normal","status":"closed","tags":["check=Active"],"text":"PING OK - Packet loss = 0%, RTA = 0.07 ms","timeout":86400,"trendIndication":"lessSevere","type":"nagiosHostAlert","value":"1/10 (Hard)"},"id":"8e3450ae-77dc-471b-8241-2643814e6648","status":"ok"}
[1530819414] [curl] Connection #0 to host localhost left intact
[1530819414] [alerta] HTTP response OK (status=201)
[1530819429] [alerta] Heartbeat service check OK.
[1530819429] {"origin": "nagios/localhost", "type": "Heartbeat", "customer": "", "tags": ["4.0.0"]}
[1530819429] [curl] Connection 0 seems to be dead!
[1530819429] [curl] Closing connection 0
[1530819429] [curl] Hostname localhost was found in DNS cache
[1530819429] [curl] Trying 127.0.0.1...
[1530819429] [curl] Connected to localhost (127.0.0.1) port 8080 (#1)
[1530819429] [curl] POST /heartbeat HTTP/1.1^M
Host: localhost:8080^M
User-Agent: Nagios-Alerta Gateway/4.0.0^M
Accept: */*^M
Content-Type: application/json^M
Content-Length: 86^M
^M
{"origin": "nagios/localhost", "type": "Heartbeat", "customer": "", "tags": ["4.0.0"]}R<97>ÿ^?
[1530819429] [curl] {"origin": "nagios/localhost", "type": "Heartbeat", "customer": "", "tags": ["4.0.0"]}R<97>ÿ^?
[1530819429] [curl] upload completely sent off: 86 out of 86 bytes
[1530819430] [curl] HTTP/1.1 201 CREATED
[1530819430] [curl] Date: Thu, 05 Jul 2018 19:37:09 GMT
[1530819430] [curl] Server: Apache/2.4.18 (Ubuntu)
[1530819430] [curl] Access-Control-Allow-Origin: http://localhost
[1530819430] [curl] Vary: Origin
[1530819430] [curl] Content-Length: 409
[1530819430] ...
So I'm not sure why you aren't seeing anything. Are you looking in the correct nagios server log file?
from docker-alerta.
Same log as you, also have you ever tried with alerta behind https?
from docker-alerta.
That's the only output I have from alerta in nagios
[1530820154] [alerta] debug is on
[1530820154] [alerta] states=Hard/Soft
[1530820154] [alerta] Forward service checks, host checks and downtime to https://example.org:9002```
from docker-alerta.
Do you have the next line? [1530819409] Event broker module '/usr/lib/nagios/alerta-neb.o' initialized successfully.
??
That would seem to be the most important as it indicates that the module has successfully bound to the internal event bus.
from docker-alerta.
yes I do
[1530820443] [alerta] Initialising Nagios-Alerta Gateway module, v4.0.0
[1530820443] [alerta] debug is on
[1530820443] [alerta] states=Hard/Soft
[1530820443] [alerta] Forward service checks, host checks and downtime to https://example.org:9002
[1530820443] Event broker module '/usr/lib/nagios/alerta-neb.o' initialized successfully.
from docker-alerta.
Anything we can do? after a day we are not getting any kind of logs from it
from docker-alerta.
What happens after Event broker module '/usr/lib/nagios/alerta-neb.o' initialized successfully
? Can you supply the full logs? It's difficult to help you unless you supply as much info as you have.
from docker-alerta.
The full log that we have is thatone, after that just alerts showing up like this:
[1531400625] Warning: Return code of 255 for check of service 'XXXX' on host 'servername.com' was out of bounds.
[1531400625] SERVICE ALERT: servername.com;Latency;UNKNOWN;SOFT;1;ZFC_V2 LATENCY UNKNOWN - Can't find results, please check your configuration.
[1531400634] SERVICE ALERT: servername.com;Onload - Cart;CRITICAL;HARD;2;ZFC_V2 ONLOAD CRITICAL - servername.com : 17840.000ms - threshold:6000ms
[1531400635] SERVICE ALERT: servername.com;Memory Pages input per second;WARNING;SOFT;1;WARNING: \Memory\Pages Input/sec: 1273.41 > warning
[1531400638] Warning: Return code of 255 for check of service....
from docker-alerta.
anything about this?
from docker-alerta.
All I can suggest at this stage is that you closely follow the install and configuration of the vagrant box I use to test the Nagios integration ... https://github.com/alerta/vagrant-try-alerta/blob/master/Vagrantfile#L72
I would launch this vagrant box and make sure i understand that it works and that I understand all the install steps and configuration settings. Then I would cross-reference that in your environment and see where things are different.
Let me know if you need help installing vagrant or getting this vagrant box running.
from docker-alerta.
Closing for now. Reopen or just add a comment below if you need more help.
from docker-alerta.
Related Issues (20)
- Alerta Docker error HOT 9
- Improve nginx logging format
- Former images broken? HOT 6
- uWSGI worker threads simultaneously restart causing dropped connections HOT 1
- Missing permissions on Housekeeping API key with customer_view enabled
- export SECRET_KEY in docker-entrypoint.sh takes precedence over SECRET_KEY in /etc/alertad.conf
- Upstream timed out (110: Connection timed out) while reading response header from upstream HOT 3
- Dockerhub alerta-web 8.7.0 with Mongo 4.4.2 stops responding HOT 7
- ERROR: duplicate key value violates unique constraint "keys_key_key" HOT 3
- nginx example build fails because python is missing HOT 2
- ORDER BY (false) HOT 4
- Error: failed to retrieve client config from Alerta API endpoint /api/ config HOT 2
- ARM64 image ? HOT 1
- NGINX returns 413 error when alert webhook is too large
- management/manifest endpoint broken in 9.0.1 HOT 2
- Alerta does not pick up on non-default Postgres credentials
- Why alerta user is member of root group HOT 2
- uWSGI is in maintenance mode HOT 1
- /auth/ in Keycloak URL HOT 1
- Bump base docker image, mongo, postgres and nginx
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-alerta.