Closed titansmc closed 6 years ago
Hi, of course status syncing is a main idea is this software.
Check you zabbix-cachet logs for investigation.
I have not tested zabbix-cachet with Cachet 2.5.0-dev.
Currently stable version of Cachet is 2.3 as I know.
On Mon, Jun 18, 2018, 1:40 PM titansmc notifications@github.com wrote:
I have a trigger displayed in Zabbix
[image: image] https://user-images.githubusercontent.com/8192096/41531719-960778d4-72f4-11e8-871e-2b9aed30a464.png
But in Cachet I still see:
[image: image] https://user-images.githubusercontent.com/8192096/41531686-77a92928-72f4-11e8-8383-704bfd6ff78c.png
Is zabbix-cachet supposed to change status from operational to problem in Cachet when the trigger is happening in zabbix?
I am using zabbix 3, cachet 2.5.0-dev
Thanks
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/qk4l/zabbix-cachet/issues/38, or mute the thread https://github.com/notifications/unsubscribe-auth/AIAVSwb8LeDZgmZcJVHyQYyQ_kPKBX-jks5t94OygaJpZM4UrhS1 .
-- Best regards, Artyom
I am running now cachet v2.3.14 and still facing the same problem, those are the logs from zabbix-cachet :
2018-06-19 07:59:57 DEBUG: (MainThread) Sending to http://projects.example.com/api/v1/components: {}
2018-06-19 07:59:57 DEBUG: (MainThread) Response Body: {
"meta": {
"pagination": {
"total": 2,
"per_page": 20,
"total_pages": 1,
"count": 2,
"current_page": 1,
"links": {
"next_page": null,
"previous_page": null
}
}
},
"data": [
{
"name": "W7 embldom",
"description": "Zabbix agent on w7-embldom.example.com is unavailable for 5 minutes",
"status_name": "Operational",
"updated_at": "2018-06-18 11:52:53",
"order": 0,
"enabled": true,
"created_at": "2018-06-15 13:17:12",
"group_id": 0,
"tags": [],
"deleted_at": null,
"id": 4,
"link": "",
"status": 1
},
{
"name": "Moscardo host",
"description": "Zabbix agent on moscardo.example.com is unavailable for 5 minutes",
"status_name": "Operational",
"updated_at": "2018-06-18 14:07:55",
"order": 0,
"enabled": true,
"created_at": "2018-06-18 14:07:55",
"group_id": 0,
"tags": [],
"deleted_at": null,
"id": 5,
"link": "",
"status": 1
}
]
}
What I don't understand is why if a trigger is in action, it is still displaying the item as Operational with green light.
What I don't understand is why if a trigger is in action, it is still displaying the item as Operational with green light.
There are two threads first one (MainThread) sync services between services and another sync statuses of triggers.
What is 'Trigger Watcher' says?
Do you mean this?
2018-06-19 07:59:57 INFO: (MainThread) Successfully synced Cachet components with Zabbix Services
2018-06-19 07:59:57 INFO: (MainThread) Restart triggers_watcher worker
2018-06-19 07:59:57 DEBUG: (MainThread) List of watching triggers [{'component_id': 4, 'triggerid': '16995', 'component_name': 'W7 embldom'}, {'component_id': 5, 'triggerid': '17262', 'component_name': 'Moscardo host'}]
2018-06-19 07:59:57 INFO: (Trigger Watcher) start trigger watcher
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) check Zabbix triggers
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) Sending: {
"params": {},
"jsonrpc": "2.0",
"method": "apiinfo.version",
"id": 5
}
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) Response Code: 200
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) Response Body: {
"id": 5,
"jsonrpc": "2.0",
"result": "3.0.2"
}
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) Sending: {
"auth": "55c48df401983e32d62d2464b2ca2141",
"params": {
"expandDescription": "true",
"expandComment": "true",
"triggerids": "16995"
},
"jsonrpc": "2.0",
"method": "trigger.get",
"id": 6
}
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) Response Code: 200
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) Response Body: {
"id": 6,
"jsonrpc": "2.0",
"result": [
{
"description": "Zabbix agent on w7-embldom.example.com is unavailable for 5 minutes",
"lastchange": "1518612819",
"value": "1",
"comments": "",
"templateid": "16993",
"flags": "0",
"expression": "({TRIGGER.VALUE}=0 and {16727}=0) or ({TRIGGER.VALUE}=1 and {16728}=0)",
"triggerid": "16995",
"priority": "3",
"url": "",
"type": "0",
"error": "",
"state": "0",
"status": "0"
}
]
}
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) Sending: {
"auth": "55c48df401983e32d62d2464b2ca2141",
"params": {
"value": 1,
"expandDescription": "true",
"objectids": "16995",
"select_acknowledges": "extend",
"object": 0
},
"jsonrpc": "2.0",
"method": "event.get",
"id": 7
}
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) Response Code: 200
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) Response Body: {
"id": 7,
"jsonrpc": "2.0",
"result": [
{
"ns": "493566328",
"eventid": "4400834",
"object": "0",
"objectid": "16995",
"value": "1",
"acknowledges": [],
"acknowledged": "0",
"source": "0",
"clock": "1518612819"
}
]
}
Exactly.
Here we see that zabbix-cachet found a problem eventid "4400834" and it should update Cachet status on next step.
It looks that it never happens the update.... The trigger never changes the status.... Here is my config file, in case it helps:
[root@projects zabbix-cachet]# cat config.yml
---
zabbix:
user: Admin
pass: zabbix
server: http://montest.example.com/zabbix
https-verify: false
cachet:
token: yHrXELcLntCXVlgrnW6e
server: http://projects.example.com
https-verify: false
settings:
# IT Service which will be a root for Cachet Components
# Leave it empty if you want to use /
root_service: ''
# How often check Zabbix for new incidents
update_inc_interval: 60 # in seconds
# How often check Zabbix for new IT Services
update_comp_interval: 3600 # in seconds
# Log level https://docs.python.org/3.4/library/logging.html#levels
log_level: DEBUG
# Additional logging level for requests module
log_level_requests: WARNING
# Templates for incident displaying
# Fill free to use Markdown
templates:
# Template for acknowledgements (acknowledgement)
# Supported fields:
# message: acknowledgement msg
# ack_time: acknowledgement time
# author: First name + Surname of Zabbix user
acknowledgement: "{message}\n\n###### {ack_time} by {author}\n\n______\n"
# Template for new incinents (investigating)
# Supported fields:
# group: Cachet Group
# component: Cachet Component
# time: Zabbix event time
# trigger_name: Zabbix trigger name
# trigger_description: Zabbix trigger description (comment)
investigating: "{group} | {component} check **failed** - {time}\n\n```{trigger_name}```"
# Template for resolved incinents (resolving)
# Supported fields:
# time: Incindent resolved time in Cachet
resolving: "__Resolved__ - {time}\n\n______\n"
It looks that it never happens the update.... The trigger never changes the status....
Do you mean that after
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) Response Code: 200
2018-06-19 07:59:57 DEBUG: (Trigger Watcher) Response Body: {
"id": 7,
"jsonrpc": "2.0",
"result": [
{
"ns": "493566328",
"eventid": "4400834",
"object": "0",
"objectid": "16995",
"value": "1",
"acknowledges": [],
"acknowledged": "0",
"source": "0",
"clock": "1518612819"
}
]
}
Trigger Watcher returns and starts next loop with?
DEBUG: (Trigger Watcher) check Zabbix triggers
Do you have something in logs between that messages?
this is how the full log looks like: https://gist.github.com/qk4l/4d3ad51823e79cf11fc32b21d7338f1b
There is no any 'Trigger Watcher' logs there, I guess that thread that sync statuses died long before.
Try to find ERROR using grep
/find thought all logs since start or restart zabbix-cachet
to catch error again.
This is the updated log since I have restarted it:
https://gist.github.com/qk4l/00d976161c9bcde4e89a62ec5370a948
You could lost some logs with python exception in stderr.
How do you run script (docker, deb, cli)?
Please try a updated version of zabbix-cachet from 5dc0660 it should works properly.
I am running it through docker (as per the instructions) I just pulled the latest version of the code and I still cannot see the updates, after 10min of running it, I can only see those logs:
2018-06-20 07:16:23 INFO: (MainThread) Zabbix Cachet v.1.3.5 started
2018-06-20 07:16:23 INFO: (MainThread) JSON-RPC Server Endpoint: http://montest.example.com/zabbix/api_jsonrpc.php
2018-06-20 07:16:23 DEBUG: (MainThread) Sending: {
"jsonrpc": "2.0",
"params": {
"user": "Admin",
"password": "zabbix"
},
"method": "user.login",
"id": 0
}
2018-06-20 07:16:23 DEBUG: (MainThread) Response Code: 200
2018-06-20 07:16:23 DEBUG: (MainThread) Response Body: {
"jsonrpc": "2.0",
"result": "4a23e6d3673df31aa06a64a1c5f4f47f",
"id": 0
}
2018-06-20 07:16:23 DEBUG: (MainThread) Sending: {
"jsonrpc": "2.0",
"params": {},
"method": "apiinfo.version",
"id": 1
}
2018-06-20 07:16:23 DEBUG: (MainThread) Response Code: 200
2018-06-20 07:16:23 DEBUG: (MainThread) Response Body: {
"jsonrpc": "2.0",
"result": "3.0.2",
"id": 1
}
2018-06-20 07:16:23 DEBUG: (MainThread) Sending to http://projects.example.com/api/v1/version: {}
2018-06-20 07:16:23 DEBUG: (MainThread) Response Body: {
"data": "2.3.12",
"meta": {
"latest": {
"tag_name": "v2.3.15",
"draft": false,
"prelease": false
},
"on_latest": true
}
}
2018-06-20 07:16:23 INFO: (MainThread) Zabbix ver: 3.0.2. Cachet ver: 2.3.12
2018-06-20 07:16:23 DEBUG: (MainThread) Getting list of Zabbix IT Services ...
2018-06-20 07:16:23 DEBUG: (MainThread) Sending: {
"jsonrpc": "2.0",
"params": {
"output": "extend",
"selectDependencies": "extend"
},
"auth": "4a23e6d3673df31aa06a64a1c5f4f47f",
"method": "service.get",
"id": 2
}
2018-06-20 07:16:23 DEBUG: (MainThread) Response Code: 200
2018-06-20 07:16:23 DEBUG: (MainThread) Response Body: {
"jsonrpc": "2.0",
"result": [
{
"dependencies": [],
"serviceid": "2",
"sortorder": "0",
"showsla": "0",
"goodsla": "99.9000",
"status": "3",
"name": "W7 embldom",
"algorithm": "1",
"triggerid": "16995"
},
{
"dependencies": [],
"serviceid": "3",
"sortorder": "0",
"showsla": "0",
"goodsla": "99.9000",
"status": "0",
"name": "Moscardo host",
"algorithm": "1",
"triggerid": "17262"
},
{
"dependencies": [],
"serviceid": "4",
"sortorder": "0",
"showsla": "0",
"goodsla": "99.9000",
"status": "0",
"name": "Blaz",
"algorithm": "1",
"triggerid": "16985"
}
],
"id": 2
}
2018-06-20 07:16:23 DEBUG: (MainThread) Zabbix IT Services: [{'dependencies': [], 'serviceid': '2', 'sortorder': '0', 'showsla': '0', 'goodsla': '99.9000', 'status': '3', 'name': 'W7 embldom', 'algorithm': '1', 'triggerid': '16995'}, {'dependencies': [], 'serviceid': '3', 'sortorder': '0', 'showsla': '0', 'goodsla': '99.9000', 'status': '0', 'name': 'Moscardo host', 'algorithm': '1', 'triggerid': '17262'}, {'dependencies': [], 'serviceid': '4', 'sortorder': '0', 'showsla': '0', 'goodsla': '99.9000', 'status': '0', 'name': 'Blaz', 'algorithm': '1', 'triggerid': '16985'}]
2018-06-20 07:16:23 DEBUG: (MainThread) Syncing Zabbix with Cachet...
2018-06-20 07:16:23 DEBUG: (MainThread) Sending: {
"jsonrpc": "2.0",
"params": {
"expandComment": "true",
"triggerids": "16995",
"expandDescription": "true"
},
"auth": "4a23e6d3673df31aa06a64a1c5f4f47f",
"method": "trigger.get",
"id": 3
}
2018-06-20 07:16:23 DEBUG: (MainThread) Response Code: 200
2018-06-20 07:16:23 DEBUG: (MainThread) Response Body: {
"jsonrpc": "2.0",
"result": [
{
"description": "Zabbix agent on w7-embldom.example.com is unavailable for 5 minutes",
"priority": "3",
"state": "0",
"triggerid": "16995",
"status": "0",
"comments": "",
"type": "0",
"lastchange": "1518612819",
"value": "1",
"flags": "0",
"error": "",
"expression": "({TRIGGER.VALUE}=0 and {16727}=0) or ({TRIGGER.VALUE}=1 and {16728}=0)",
"url": "",
"templateid": "16993"
}
],
"id": 3
}
2018-06-20 07:16:23 DEBUG: (MainThread) Sending to http://projects.example.com/api/v1/components: {}
2018-06-20 07:16:23 DEBUG: (MainThread) Response Body: {
"data": [
{
"description": "Zabbix agent on w7-embldom.example.com is unavailable for 5 minutes",
"updated_at": "2018-06-18 11:52:53",
"enabled": true,
"group_id": 0,
"status": 1,
"status_name": "Operational",
"created_at": "2018-06-15 13:17:12",
"tags": [],
"id": 4,
"deleted_at": null,
"link": "",
"name": "W7 embldom",
"order": 0
},
{
"description": "Zabbix agent on moscardo.example.com is unavailable for 5 minutes",
"updated_at": "2018-06-18 14:07:55",
"enabled": true,
"group_id": 0,
"status": 1,
"status_name": "Operational",
"created_at": "2018-06-18 14:07:55",
"tags": [],
"id": 5,
"deleted_at": null,
"link": "",
"name": "Moscardo host",
"order": 0
},
{
"description": "Zabbix agent on montest.example.com is unavailable for 5 minutes",
"updated_at": "2018-06-19 11:59:57",
"enabled": true,
"group_id": 0,
"status": 1,
"status_name": "Operational",
"created_at": "2018-06-19 11:59:57",
"tags": [],
"id": 6,
"deleted_at": null,
"link": "",
"name": "Blaz",
"order": 0
}
],
"meta": {
"pagination": {
"links": {
"next_page": null,
"previous_page": null
},
"total": 3,
"count": 3,
"per_page": 20,
"current_page": 1,
"total_pages": 1
}
}
}
2018-06-20 07:16:23 DEBUG: (MainThread) Sending: {
"jsonrpc": "2.0",
"params": {
"expandComment": "true",
"triggerids": "17262",
"expandDescription": "true"
},
"auth": "4a23e6d3673df31aa06a64a1c5f4f47f",
"method": "trigger.get",
"id": 4
}
2018-06-20 07:16:23 DEBUG: (MainThread) Response Code: 200
2018-06-20 07:16:23 DEBUG: (MainThread) Response Body: {
"jsonrpc": "2.0",
"result": [
{
"description": "Zabbix agent on moscardo.example.com is unavailable for 5 minutes",
"priority": "3",
"state": "0",
"triggerid": "17262",
"status": "0",
"comments": "",
"type": "0",
"lastchange": "1529324721",
"value": "0",
"flags": "0",
"error": "",
"expression": "({TRIGGER.VALUE}=0 and {16996}=0) or ({TRIGGER.VALUE}=1 and {16997}=0)",
"url": "",
"templateid": "16984"
}
],
"id": 4
}
2018-06-20 07:16:23 DEBUG: (MainThread) Sending to http://projects.example.com/api/v1/components: {}
2018-06-20 07:16:23 DEBUG: (MainThread) Response Body: {
"data": [
{
"description": "Zabbix agent on w7-embldom.example.com is unavailable for 5 minutes",
"updated_at": "2018-06-18 11:52:53",
"enabled": true,
"group_id": 0,
"status": 1,
"status_name": "Operational",
"created_at": "2018-06-15 13:17:12",
"tags": [],
"id": 4,
"deleted_at": null,
"link": "",
"name": "W7 embldom",
"order": 0
},
{
"description": "Zabbix agent on moscardo.example.com is unavailable for 5 minutes",
"updated_at": "2018-06-18 14:07:55",
"enabled": true,
"group_id": 0,
"status": 1,
"status_name": "Operational",
"created_at": "2018-06-18 14:07:55",
"tags": [],
"id": 5,
"deleted_at": null,
"link": "",
"name": "Moscardo host",
"order": 0
},
{
"description": "Zabbix agent on montest.example.com is unavailable for 5 minutes",
"updated_at": "2018-06-19 11:59:57",
"enabled": true,
"group_id": 0,
"status": 1,
"status_name": "Operational",
"created_at": "2018-06-19 11:59:57",
"tags": [],
"id": 6,
"deleted_at": null,
"link": "",
"name": "Blaz",
"order": 0
}
],
"meta": {
"pagination": {
"links": {
"next_page": null,
"previous_page": null
},
"total": 3,
"count": 3,
"per_page": 20,
"current_page": 1,
"total_pages": 1
}
}
}
2018-06-20 07:16:23 DEBUG: (MainThread) Sending: {
"jsonrpc": "2.0",
"params": {
"expandComment": "true",
"triggerids": "16985",
"expandDescription": "true"
},
"auth": "4a23e6d3673df31aa06a64a1c5f4f47f",
"method": "trigger.get",
"id": 5
}
2018-06-20 07:16:23 DEBUG: (MainThread) Response Code: 200
2018-06-20 07:16:23 DEBUG: (MainThread) Response Body: {
"jsonrpc": "2.0",
"result": [
{
"description": "Zabbix agent on montest.example.com is unavailable for 5 minutes",
"priority": "3",
"state": "0",
"triggerid": "16985",
"status": "0",
"comments": "",
"type": "0",
"lastchange": "1518612816",
"value": "0",
"flags": "0",
"error": "",
"expression": "({TRIGGER.VALUE}=0 and {16707}=0) or ({TRIGGER.VALUE}=1 and {16708}=0)",
"url": "",
"templateid": "16984"
}
],
"id": 5
}
2018-06-20 07:16:23 DEBUG: (MainThread) Sending to http://projects.example.com/api/v1/components: {}
2018-06-20 07:16:23 DEBUG: (MainThread) Response Body: {
"data": [
{
"description": "Zabbix agent on w7-embldom.example.com is unavailable for 5 minutes",
"updated_at": "2018-06-18 11:52:53",
"enabled": true,
"group_id": 0,
"status": 1,
"status_name": "Operational",
"created_at": "2018-06-15 13:17:12",
"tags": [],
"id": 4,
"deleted_at": null,
"link": "",
"name": "W7 embldom",
"order": 0
},
{
"description": "Zabbix agent on moscardo.example.com is unavailable for 5 minutes",
"updated_at": "2018-06-18 14:07:55",
"enabled": true,
"group_id": 0,
"status": 1,
"status_name": "Operational",
"created_at": "2018-06-18 14:07:55",
"tags": [],
"id": 5,
"deleted_at": null,
"link": "",
"name": "Moscardo host",
"order": 0
},
{
"description": "Zabbix agent on montest.example.com is unavailable for 5 minutes",
"updated_at": "2018-06-19 11:59:57",
"enabled": true,
"group_id": 0,
"status": 1,
"status_name": "Operational",
"created_at": "2018-06-19 11:59:57",
"tags": [],
"id": 6,
"deleted_at": null,
"link": "",
"name": "Blaz",
"order": 0
}
],
"meta": {
"pagination": {
"links": {
"next_page": null,
"previous_page": null
},
"total": 3,
"count": 3,
"per_page": 20,
"current_page": 1,
"total_pages": 1
}
}
}
2018-06-20 07:16:23 INFO: (MainThread) Successfully synced Cachet components with Zabbix Services
2018-06-20 07:16:23 INFO: (MainThread) Restart triggers_watcher worker
2018-06-20 07:16:23 DEBUG: (MainThread) List of watching triggers [{'component_name': 'W7 embldom', 'component_id': 4, 'triggerid': '16995'}, {'component_name': 'Moscardo host', 'component_id': 5, 'triggerid': '17262'}, {'component_name': 'Blaz', 'component_id': 6, 'triggerid': '16985'}]
2018-06-20 07:16:23 INFO: (Trigger Watcher) start trigger watcher
2018-06-20 07:16:23 DEBUG: (Trigger Watcher) check Zabbix triggers
2018-06-20 07:16:23 DEBUG: (Trigger Watcher) Sending: {
"jsonrpc": "2.0",
"params": {},
"method": "apiinfo.version",
"id": 6
}
2018-06-20 07:16:23 DEBUG: (Trigger Watcher) Response Code: 200
2018-06-20 07:16:23 DEBUG: (Trigger Watcher) Response Body: {
"jsonrpc": "2.0",
"result": "3.0.2",
"id": 6
}
2018-06-20 07:16:23 DEBUG: (Trigger Watcher) Sending: {
"jsonrpc": "2.0",
"params": {
"expandComment": "true",
"triggerids": "16995",
"expandDescription": "true"
},
"auth": "4a23e6d3673df31aa06a64a1c5f4f47f",
"method": "trigger.get",
"id": 7
}
2018-06-20 07:16:23 DEBUG: (Trigger Watcher) Response Code: 200
2018-06-20 07:16:23 DEBUG: (Trigger Watcher) Response Body: {
"jsonrpc": "2.0",
"result": [
{
"description": "Zabbix agent on w7-embldom.example.com is unavailable for 5 minutes",
"priority": "3",
"state": "0",
"triggerid": "16995",
"status": "0",
"comments": "",
"type": "0",
"lastchange": "1518612819",
"value": "1",
"flags": "0",
"error": "",
"expression": "({TRIGGER.VALUE}=0 and {16727}=0) or ({TRIGGER.VALUE}=1 and {16728}=0)",
"url": "",
"templateid": "16993"
}
],
"id": 7
}
2018-06-20 07:16:23 DEBUG: (Trigger Watcher) Sending: {
"jsonrpc": "2.0",
"params": {
"value": 1,
"object": 0,
"objectids": "16995",
"select_acknowledges": "extend",
"expandDescription": "true"
},
"auth": "4a23e6d3673df31aa06a64a1c5f4f47f",
"method": "event.get",
"id": 8
}
2018-06-20 07:16:23 DEBUG: (Trigger Watcher) Response Code: 200
2018-06-20 07:16:23 DEBUG: (Trigger Watcher) Response Body: {
"jsonrpc": "2.0",
"result": [
{
"value": "1",
"ns": "493566328",
"object": "0",
"acknowledges": [],
"eventid": "4400834",
"objectid": "16995",
"source": "0",
"clock": "1518612819",
"acknowledged": "0"
}
],
"id": 8
}
Please update your image and recreate container.
Currently 1.3.5 is using. Yesterday changes are in 1.3.6.
2018-06-20 07:16:23 INFO: (MainThread) Zabbix Cachet v.1.3.5 started
Sorry, I didn't pull the image... it looks fine now. Thanks a lot.
You are welcome. Thank you for bug case!
I have a trigger displayed in Zabbix
But in Cachet I still see:
So if you hoover the "?" you see the trigger but the green light is always "Operational"
Is zabbix-cachet supposed to change status from operational to problem in Cachet when the trigger is happening in zabbix?
I am using zabbix 3, cachet 2.5.0-dev
Thanks