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

Wireguard error when polling #500

Open
michmoor0725 opened this issue Dec 18, 2023 · 3 comments
Open

Wireguard error when polling #500

michmoor0725 opened this issue Dec 18, 2023 · 3 comments

Comments

@michmoor0725
Copy link

michmoor0725 commented Dec 18, 2023

Receiving the following output when polling via the LibreNMS GUI

wireguard:1:Script returned exception: Command Execution Error: 'Command '['/bin/wg', 'show', 'wg0', 'dump']' returned non-zero exit status 1.'

command works without issue

root@libreNMS:/etc/snmp# wg show all dump
wg0 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= 41073 off
wg0 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= (none) 1.1.2.2.2:51821 192.168.50.0/24,192.168.3.0/24,192.168.15.0/24,192.168.70.0/24,10.30.1.0/24,172.26.0.0/24,192.168.69.0/24 1702879153 8076598016 2675459028 off

Libre Version: 23.11.0

@bnerickson
Copy link
Contributor

Do you have SELinux running? If so, you'll probably need to install a custom module to permit snmp executing the script.

(0) [22:08:04] [root@server:/root]
# getenforce
Enforcing

Otherwise, it may be a permissions issue. I get a failed execution if I run the command as an unprivileged user:

$ wg show wg0 dump
Unable to access interface: Operation not permitted

(1) [22:11:16] [user@server:/home/user]

@michmoor0725
Copy link
Author

I am on Ubuntu 23.10

The problem seems to stem from an incorrect parameter being parsed. I am running the script as root and there is an error string?

root@libreNMS:/etc/snmp# ls -ltrh | grep wireguard.py
-rwxr-xr-x 1 root root        9.5K Dec 18 00:19 wireguard.py


root@libreNMS:/etc/snmp# ./wireguard.py
{"errorString": "", "error": 0, "version": 1, "data": {"wg0": {"GeorgiaFirewall": {"minutes_since_last_handshake": 0, "bytes_rcvd": 8930240544, "bytes_sent": 2810537456}}}}



@bnerickson
Copy link
Contributor

No, an empty error string and an error 0 indicates that there is no error.

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