Ad Widget

Collapse

Monitor OpenVPN log on linux, couple questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Maxburn
    Member
    • Sep 2019
    • 48

    #1

    Monitor OpenVPN log on linux, couple questions

    Two Questions;

    1: First off my active check for the log file fails with zabbix server error;

    Code:
    Cannot open file "/var/log/openvpn/openvpn-status.log": [13] Permission denied
    Agent log contains similar;

    Code:
    24913:20210527:081520.363 active check "log.count[/var/log/openvpn/openvpn-status.log,^client,ANSI,100,all,0]" is not supported: Cannot open file "/var/log/openvpn/openvpn-status.log": [13] Permission denied
    This is Ubuntu 20.04. I'm not a pro linux user, what would be the best course to correct this? Move the log file somewhere it has permission? Give the agent more permission somehow for this active check? Recommendations?



    2: I can see the next problem coming, windows OpenVPN log file item I am searching for with key I am using in Zabbix looks like this;

    Log;
    Code:
    client3,[URL="https://192.168.110.254:10881/"]192.168.130.250:10881[/URL],4769698,4602982,2021-05-19 11:50:44
    key;
    Code:
    log.count[C:\Program Files\OpenVPN\log\openvpn-status.log,^client,ANSI,100,all,0]
    Linux looks different and presents a regex problem ( I think );

    Log;
    Code:
    CLIENT_LIST,client1,[URL="https://206.74.242.6:54122/"]206.79.256.6:54122[/URL],[URL="https://10.8.0.11/"]10.8.0.11[/URL],,15927676,3073466,Tue May 25 11:54:01
    Suggested key;
    Code:
    log.count[/var/log/openvpn/openvpn-status.log,^CLIENT_LIST,client,ANSI,100,all,0]
    That extra comma is going to present a problem, correct? Can I contain that with quotes or something like I can in CLI?
  • Maxburn
    Member
    • Sep 2019
    • 48

    #2
    Originally posted by cyber
    yes. you can put your regex in ""-s.
    "^CLIENT_LIST,client"
    Thank you, that's very helpful. I barely have a handle on this regex stuff.

    Any best practice suggestion on getting Zabbix able to read the OpenVPN log file?

    Comment

    • Maxburn
      Member
      • Sep 2019
      • 48

      #3
      Also I tried zabbix config "AllowRoot=1" but it didn't work. ps -ef still shows it running under zabbix user. Probably not a good idea anyway.

      Comment

      • Maxburn
        Member
        • Sep 2019
        • 48

        #4
        Turns out "chmod 644 openvpn-status.log" is the only thing I needed. I was worried I would have to mess with the folders leading up to it too but nope.

        Comment

        • cyber
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Dec 2006
          • 4806

          #5
          yes. you can put your regex in ""-s.
          "^CLIENT_LIST,client"

          Comment

          • cyber
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Dec 2006
            • 4806

            #6
            unfortunately no... Never seen any of openVPN logfiles... never needed.

            Comment

            Working...