File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ func (e *Exporter) updateStatus() {
6565 vpnIPsBanned .Reset ()
6666 return
6767 }
68+ vpnStartTime .WithLabelValues ().Set (float64 (status .RawUpSince ))
6869 vpnActiveSessions .WithLabelValues ().Set (float64 (status .ActiveSessions ))
6970 vpnHandledSessions .WithLabelValues ().Set (float64 (status .HandledSessions ))
7071 vpnIPsBanned .WithLabelValues ().Set (float64 (status .IPsBanned ))
Original file line number Diff line number Diff line change 1818 Name : "occtl_users_scrape_error_total" ,
1919 Help : "Total number of errors that occurred when calling occtl show users." ,
2020 }, []string {})
21+ vpnStartTime = prometheus .NewGaugeVec (prometheus.GaugeOpts {
22+ Name : "vpn_start_time_seconds" ,
23+ Help : "Start time of ocserv since unix epoch in seconds." ,
24+ }, []string {})
2125 vpnActiveSessions = prometheus .NewGaugeVec (prometheus.GaugeOpts {
2226 Name : "vpn_active_sessions" ,
2327 Help : "Current number of users connected." ,
@@ -98,6 +102,7 @@ func main() {
98102 prometheus .MustRegister (
99103 occtlStatusScrapeError ,
100104 occtlUsersScrapeError ,
105+ vpnStartTime ,
101106 vpnActiveSessions ,
102107 vpnHandledSessions ,
103108 vpnIPsBanned ,
You can’t perform that action at this time.
0 commit comments