OpenVPN server user connection notification












0















I've setup an OpenVPN complete server, perfectly working and everything okay.



I've tried to setup and email notification when a user connects to the vpn, but the params pointed on the documentation (--client-connect/--client-disconnect) doesn't work (said by official support).



So now, i am triying to make a manual notification based on the output of the command VPNStatus of the /usr/local/openvpn_as/scripts/sacli VPNStatus which output a json with client info:



{
"openvpn_0": {
"client_list": [
[
"username",
"real_ip:port",
"virtual_ip",
"",
"5081",
"6749",
"Tue Feb 5 08:34:35 2019",
"1549355675",
"username",
"1624",
"0"
]
],
"client_list_header": {
"Bytes Received": 4,
"Bytes Sent": 5,
"Client ID": 9,
"Common Name": 0,
"Connected Since": 6,
"Connected Since (time_t)": 7,
"Peer ID": 10,
"Real Address": 1,
"Username": 8,
"Virtual Address": 2,
"Virtual IPv6 Address": 3
},
"global_stats": {
"Max bcast/mcast queue length": "0"
},
"routing_table": [
[
"virtual_ip",
"username",
"real_ip:port",
"Tue Feb 5 08:34:37 2019",
"1549355677"
]
],
"routing_table_header": {
"Common Name": 1,
"Last Ref": 3,
"Last Ref (time_t)": 4,
"Real Address": 2,
"Virtual Address": 0
},
"time": [
"Tue Feb 5 08:34:41 2019",
"1549355681"
],
"title": "OpenVPN 2.4.3 [git:release/2.4/c7e259160b28e94e+] x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Dec 24 2018"
}
}


I am not sure about which can be the best way to notify the user that he's connected having that info.



Some script in python parsing the info and make temporal files to not re-notify clients notified?
Something in bash analizing the diffs between json and json report?



Thanks for help










share|improve this question



























    0















    I've setup an OpenVPN complete server, perfectly working and everything okay.



    I've tried to setup and email notification when a user connects to the vpn, but the params pointed on the documentation (--client-connect/--client-disconnect) doesn't work (said by official support).



    So now, i am triying to make a manual notification based on the output of the command VPNStatus of the /usr/local/openvpn_as/scripts/sacli VPNStatus which output a json with client info:



    {
    "openvpn_0": {
    "client_list": [
    [
    "username",
    "real_ip:port",
    "virtual_ip",
    "",
    "5081",
    "6749",
    "Tue Feb 5 08:34:35 2019",
    "1549355675",
    "username",
    "1624",
    "0"
    ]
    ],
    "client_list_header": {
    "Bytes Received": 4,
    "Bytes Sent": 5,
    "Client ID": 9,
    "Common Name": 0,
    "Connected Since": 6,
    "Connected Since (time_t)": 7,
    "Peer ID": 10,
    "Real Address": 1,
    "Username": 8,
    "Virtual Address": 2,
    "Virtual IPv6 Address": 3
    },
    "global_stats": {
    "Max bcast/mcast queue length": "0"
    },
    "routing_table": [
    [
    "virtual_ip",
    "username",
    "real_ip:port",
    "Tue Feb 5 08:34:37 2019",
    "1549355677"
    ]
    ],
    "routing_table_header": {
    "Common Name": 1,
    "Last Ref": 3,
    "Last Ref (time_t)": 4,
    "Real Address": 2,
    "Virtual Address": 0
    },
    "time": [
    "Tue Feb 5 08:34:41 2019",
    "1549355681"
    ],
    "title": "OpenVPN 2.4.3 [git:release/2.4/c7e259160b28e94e+] x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Dec 24 2018"
    }
    }


    I am not sure about which can be the best way to notify the user that he's connected having that info.



    Some script in python parsing the info and make temporal files to not re-notify clients notified?
    Something in bash analizing the diffs between json and json report?



    Thanks for help










    share|improve this question

























      0












      0








      0








      I've setup an OpenVPN complete server, perfectly working and everything okay.



      I've tried to setup and email notification when a user connects to the vpn, but the params pointed on the documentation (--client-connect/--client-disconnect) doesn't work (said by official support).



      So now, i am triying to make a manual notification based on the output of the command VPNStatus of the /usr/local/openvpn_as/scripts/sacli VPNStatus which output a json with client info:



      {
      "openvpn_0": {
      "client_list": [
      [
      "username",
      "real_ip:port",
      "virtual_ip",
      "",
      "5081",
      "6749",
      "Tue Feb 5 08:34:35 2019",
      "1549355675",
      "username",
      "1624",
      "0"
      ]
      ],
      "client_list_header": {
      "Bytes Received": 4,
      "Bytes Sent": 5,
      "Client ID": 9,
      "Common Name": 0,
      "Connected Since": 6,
      "Connected Since (time_t)": 7,
      "Peer ID": 10,
      "Real Address": 1,
      "Username": 8,
      "Virtual Address": 2,
      "Virtual IPv6 Address": 3
      },
      "global_stats": {
      "Max bcast/mcast queue length": "0"
      },
      "routing_table": [
      [
      "virtual_ip",
      "username",
      "real_ip:port",
      "Tue Feb 5 08:34:37 2019",
      "1549355677"
      ]
      ],
      "routing_table_header": {
      "Common Name": 1,
      "Last Ref": 3,
      "Last Ref (time_t)": 4,
      "Real Address": 2,
      "Virtual Address": 0
      },
      "time": [
      "Tue Feb 5 08:34:41 2019",
      "1549355681"
      ],
      "title": "OpenVPN 2.4.3 [git:release/2.4/c7e259160b28e94e+] x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Dec 24 2018"
      }
      }


      I am not sure about which can be the best way to notify the user that he's connected having that info.



      Some script in python parsing the info and make temporal files to not re-notify clients notified?
      Something in bash analizing the diffs between json and json report?



      Thanks for help










      share|improve this question














      I've setup an OpenVPN complete server, perfectly working and everything okay.



      I've tried to setup and email notification when a user connects to the vpn, but the params pointed on the documentation (--client-connect/--client-disconnect) doesn't work (said by official support).



      So now, i am triying to make a manual notification based on the output of the command VPNStatus of the /usr/local/openvpn_as/scripts/sacli VPNStatus which output a json with client info:



      {
      "openvpn_0": {
      "client_list": [
      [
      "username",
      "real_ip:port",
      "virtual_ip",
      "",
      "5081",
      "6749",
      "Tue Feb 5 08:34:35 2019",
      "1549355675",
      "username",
      "1624",
      "0"
      ]
      ],
      "client_list_header": {
      "Bytes Received": 4,
      "Bytes Sent": 5,
      "Client ID": 9,
      "Common Name": 0,
      "Connected Since": 6,
      "Connected Since (time_t)": 7,
      "Peer ID": 10,
      "Real Address": 1,
      "Username": 8,
      "Virtual Address": 2,
      "Virtual IPv6 Address": 3
      },
      "global_stats": {
      "Max bcast/mcast queue length": "0"
      },
      "routing_table": [
      [
      "virtual_ip",
      "username",
      "real_ip:port",
      "Tue Feb 5 08:34:37 2019",
      "1549355677"
      ]
      ],
      "routing_table_header": {
      "Common Name": 1,
      "Last Ref": 3,
      "Last Ref (time_t)": 4,
      "Real Address": 2,
      "Virtual Address": 0
      },
      "time": [
      "Tue Feb 5 08:34:41 2019",
      "1549355681"
      ],
      "title": "OpenVPN 2.4.3 [git:release/2.4/c7e259160b28e94e+] x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Dec 24 2018"
      }
      }


      I am not sure about which can be the best way to notify the user that he's connected having that info.



      Some script in python parsing the info and make temporal files to not re-notify clients notified?
      Something in bash analizing the diffs between json and json report?



      Thanks for help







      vpn openvpn notification json






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      WilliWonkaWilliWonka

      485




      485






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1115760%2fopenvpn-server-user-connection-notification%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1115760%2fopenvpn-server-user-connection-notification%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Category:香港粉麵

          List *all* the tuples!

          Channel [V]