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

Additional type of device control - SSH #21

Open
FrostbyteGR opened this issue Mar 12, 2024 · 1 comment
Open

Additional type of device control - SSH #21

FrostbyteGR opened this issue Mar 12, 2024 · 1 comment

Comments

@FrostbyteGR
Copy link

FrostbyteGR commented Mar 12, 2024

Greetings,

I was wondering, whether an SSH type of device control could be implemented into the project.

Here's a generic example:

name: maaspower ssh example
ip_address: <SSH_IP>
port: 22
username: <USERNAME>
password: <PASSWORD>
ssh-key: <SSH_KEY_FILE_PATH>
devices:
- type: SSH
    name: RPi01
    on: <POE_ON_COMMAND>
    off: <POE_OFF_COMMAND>
    query: <POE_QUERY_COMMAND>
    query_on_regex: <POE_QUERY_ON_REGEX>
    query_off_regex: <POE_QUERY_OFF_REGEX>

Here's another example that could possibly work with MikroTik PoE devices (i.e. CRS328-24P-4S+RM):

name: maaspower mikrotik ssh example
ip_address: <MIKROTIK_IP>
port: 22
username: <USERNAME>
password: <PASSWORD>
ssh-key: <SSH_KEY_FILE_PATH>
devices:
- type: SSH
    name: RPi01
    on: interface ethernet poe set poe-out=off <POE_INTERFACE_NAME>
    off: interface ethernet poe set poe-out=auto-on <POE_INTERFACE_NAME>
    query: interface ethernet poe monitor <POE_INTERFACE_NAME> once
    query_on_regex: ^[\t ]*poe-out-status:[\t ]+powered-on$
    query_off_regex: ^[\t ]*poe-out-status:[\t ]+waiting-for-load$

NOTE: password and ssh-key arguments should be mutually exclusive?

I believe that right now, the same thing can be achieved via type: CommandLine like this:

on: ssh -i <SSH_KEY_FILE_PATH> <USERNAME>@<SSH_IP> "<POE_ON_COMMAND>"
off: ssh -i <SSH_KEY_FILE_PATH> <USERNAME>@<SSH_IP> "<POE_OFF_COMMAND>"
query: ssh -i <SSH_KEY_FILE_PATH> <USERNAME>@<SSH_IP> "<POE_QUERY_COMMAND>"

Thus, I would consider it as a very low priority kind of request.

Many thanks for your time and efforts on this project!

@gilesknap
Copy link
Owner

This seems reasonable.

I'm not actively developing this project at present. I would look at PRs if anyone is up for trying to implement this idea.

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

No branches or pull requests

2 participants