sergeymakinen / ipsec_exporter

Export strongswan/libreswan IPsec stats to Prometheus
BSD 3-Clause "New" or "Revised" License
20 stars 16 forks source link

Username support #4

Open RRay13 opened 2 years ago

RRay13 commented 2 years ago

Hi I used libreswan,and may I have dial up username. Thank you

From exporter metrics TYPE ipsec_ike_sa_state gauge ipsec_ike_sa_state{local_host="10.1.0.2",local_id="35.XX.14.204,MS+XS+S=C",name="xauth-psk[21]",remote_host="122.117.XX.85",remote_id="+MC+XC+S=C",remote_identity="",uid="95",version="1",vips=""} 6 ipsec_ike_sa_state{local_host="10.1.0.2",local_id="35.XX.14.204,MS+XS+S=C",name="xauth-psk[22]",remote_host="123.210.XX.40",remote_id="+MC+XC+S=C",remote_identity="",uid="96",version="1",vips=""} 6

From ipsec status 000 #6: "l2tp-psk"[1] 74.82.XX.36:47274 STATE_MAIN_R0 (expecting Main Mode request); nodpd; idle; 000 #85: "l2tp-psk"[2] 118.193.XX.201:65282 STATE_MAIN_R0 (expecting Main Mode request); nodpd; idle; 000 #93: "xauth-psk"[21] 122.117.XX.85:4500 STATE_QUICK_R2 (IPsec SA established); EXPIRE in 23505s; newest; eroute owner; ISAKMP SA #83; idle; 000 #93: "xauth-psk"[21] 122.117.XX.85 esp.deb72025@122.117.XX.85 esp.14d2540b@10.1.0.2 tun.0@122.117.XX.85 tun.0@10.1.0.2 Traffic: ESPin=623MB ESPout=10062MB ESPmax=4194303B username=user1 000 #95: "xauth-psk"[21] 122.117.XX.85:4500 STATE_MAIN_R3 (IKE SA established); EXPIRE in 68211s; newest; lastdpd=18s(seq in:24172 out:0); idle; 000 #94: "xauth-psk"[22] 123.240.XX.40:4500 STATE_QUICK_R2 (IPsec SA established); EXPIRE in 23523s; newest; eroute owner; ISAKMP SA #84; idle; 000 #94: "xauth-psk"[22] 123.240.XX.40 esp.deb72026@123.240.XX.40 esp.5b7e7a5f@10.1.0.2 tun.0@123.240.XX.40 tun.0@10.1.0.2 Traffic: ESPin=0B ESPout=0B ESPmax=4194303B username=user2 000 #96: "xauth-psk"[22] 123.240.XX.40:4500 STATE_MAIN_R3 (IKE SA established); EXPIRE in 68218s; newest; lastdpd=24s(seq in:19875 out:0); idle;

sergeymakinen commented 2 years ago

Thanks for your report @RRay13, I’ll take a look later.