icmp ping #1

Open
fil wants to merge 6 commits from dev into main
Member

perform basic icmp ping

  • no check on service type (icmp-ping or http-ping)
  • creates incidents, closes incidents on next successful ping
  • on check if service is down latency is set to 0
perform basic icmp ping - no check on service type (icmp-ping or http-ping) - creates incidents, closes incidents on next successful ping - on check if service is down latency is set to 0
fil added 1 commit 2024-05-01 19:25:20 +00:00
fil added 1 commit 2024-05-01 19:26:39 +00:00
fil reviewed 2024-05-01 21:33:50 +00:00
pingpong.py Outdated
@ -0,0 +15,4 @@
state = self.db.create_state(el['id'])[0]
open_incident = self.db.get_open_incident(el['id'])
ping_data = ping(el['ipaddr'])
best_effort = sorted(ping_data, key=lambda x: x.time_elapsed_ms)[0]
Author
Member

use avg response time instead of fastest?

use avg response time instead of fastest?
Owner

Makes sense to me

Makes sense to me
fil marked this conversation as resolved
samu approved these changes 2024-05-01 22:29:22 +00:00
samu left a comment
Owner

It all makes more or less sense to me. Unfortunately I'm not a Python expert so I'm not entirely sure about some things but I don't have time to check them now.

What I would add to the repo is the structure of the db (which you sent me on telegram). Also two things I would do would be:

  1. Add the ability to use a config file instead of environment variables (maybe a yaml)
  2. Add support for ipv6
It all makes more or less sense to me. Unfortunately I'm not a Python expert so I'm not entirely sure about some things but I don't have time to check them now. What I would add to the repo is the structure of the db (which you sent me on telegram). Also two things I would do would be: 1. Add the ability to use a config file instead of environment variables (maybe a yaml) 2. Add support for ipv6
@ -0,0 +39,4 @@
self.cur.execute("""INSERT INTO incident (state_id, error)
VALUES (%s,%s) RETURNING *;""", *argv)
self.conn.commit()
return self.cur.fetchall()
Owner

Don't you have a way here to just take the state you just created? It seems pointless to me to take them all since you're only interested in the latest created anyway

Don't you have a way here to just take the state you just created? It seems pointless to me to take them all since you're only interested in the latest created anyway
fil marked this conversation as resolved
Author
Member

What I would add to the repo is the structure of the db (which you sent me on telegram)

I thought about this but I don't know if it fits well here. I think it's better to put it in ansible repo where the database is created.

> What I would add to the repo is the structure of the db (which you sent me on telegram) I thought about this but I don't know if it fits well here. I think it's better to put it in ansible repo where the database is created.
fil added 1 commit 2024-05-03 10:04:33 +00:00
fil added 1 commit 2024-05-03 10:11:00 +00:00
fil added 1 commit 2024-05-03 13:38:48 +00:00
fil added 1 commit 2024-05-03 13:49:14 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin dev:dev
git checkout dev

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout main
git merge --no-ff dev
git checkout dev
git rebase main
git checkout main
git merge --ff-only dev
git checkout dev
git rebase main
git checkout main
git merge --no-ff dev
git checkout main
git merge --squash dev
git checkout main
git merge --ff-only dev
git checkout main
git merge dev
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: adm/pingpong#1
No description provided.