Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command to ping services / Pi's #2

Open
Agent-E11 opened this issue May 2, 2024 · 3 comments
Open

Add command to ping services / Pi's #2

Agent-E11 opened this issue May 2, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Agent-E11
Copy link
Member

This should take security into account. Using os.system(f"ping -c 1 {service}") to ping a service would be insecure (e.g. someone could make service be google; sudo rm -rf /)

In this case, I think subprocess.run(["ping", "-c", "1", service]) would be more secure

@Agent-E11
Copy link
Member Author

Related to #1, and #6, because it might be a good idea to make a command that creates new services to ping, and only "bot moderators" should be able to use it

Agent-E11 added a commit that referenced this issue May 2, 2024
Integrate random greeting into greeting response

Delete TODO.md and move to issues #1, #2, #3, #4, #5, #6, #7
@Agent-E11 Agent-E11 added the enhancement New feature or request label May 2, 2024
@Agent-E11
Copy link
Member Author

There also could be a healthcheck option. Which pings all services, and gives a report

@Agent-E11
Copy link
Member Author

Or, instead of a healthcheck command, there could be a /ping group command which pings all services that are part of a group, and each service has an optional list of groups that it is part of (all services are part of the all group). For instance:

# config.yaml

# ...

services:
  google:
    address: google.com
    groups:
      - external
  pi1:
    address: 192.168.0.201
    groups:
      - internal
      - pi-cluster  
  pi1:
    address: 192.168.0.202
    groups:
      - internal
      - pi-cluster
  vm-server:
    address: 192.168.0.200
    groups:
      - internal

/ping group external

pinging services: google
/ping group internal

pinging services: pi1, pi2, vm-server
/ping group pi-cluster

pinging services: pi1, pi2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant