Hello,
Objective: to know the number of users connected to an OpenVPN Access Server.
What I want to do seems very simple: I would like, via the SSH sensor, to retrieve the number contained in the response of an order.
The original order: ./sacli VPNSummary
The result is: { "n_clients": 1 }
I found 2 ways to get out that number but PRTG can't read it.
1st solution tried: creation of a script with my order which filters only the figures:
- ! / bin / bash ./sacli VPNSummary | grep -o '[0-9] \ +'
The result is: 1
Observation with SSH console: the script works: it displays only the number. Observation with PRTG: it finds an empty answer
2nd solution tried: creation of a script with my order which filters only the figures:
- ! / bin / bash $ NUMBER = $. / Sacli VPNSummary | grep -o '[0-9] \ +' $ echo $ NUMBER
The result is: 1
Observation with SSH console: the script works: it displays only the number. Observation with PRTG: it finds an empty answer
Finally, I thought of sending my result with a cron task in a text file but by default, PRTG is not able to read a file under Linux without SMB.
Do you have an idea ?
Thank you in advance.
Add comment