fortigate_exporter icon indicating copy to clipboard operation
fortigate_exporter copied to clipboard

Metric for Session Rate

Open mwallace78 opened this issue 3 years ago • 7 comments

Would it be possible to collect Session Rate? Or even Total Sessions so we could calculate the rate in Prometheus? Specifically looking for the same values that are returned by these SNMP OIDs:

fgSysSesRate1 fgSysSesRate1 1.3.6.1.4.1.12356.101.4.1.11 fgSysSesRate10 fgSysSesRate10 1.3.6.1.4.1.12356.101.4.1.12 fgSysSesRate30 fgSysSesRate30 1.3.6.1.4.1.12356.101.4.1.13 fgSysSesRate60 fgSysSesRate60 1.3.6.1.4.1.12356.101.4.1.14

We could use SNMP, but the exporter is a lot cleaner.

Thank you.

mwallace78 avatar Aug 16 '22 18:08 mwallace78

Hi! Wouldn't fortigate_current_sessions work for this?

bluecmd avatar Aug 16 '22 19:08 bluecmd

We have a Fortigate with a lot of short lived sessions. While current sessions is useful it doesn't capture the rate at which sessions are being created and removed. This is also sometimes call setup-rate, if you are looking at performance statistics on the CLI of the Fortigate.

mwallace78 avatar Aug 16 '22 20:08 mwallace78

Ah, got it. Makes sense. Let's see if somebody figures out what API could give this.

bluecmd avatar Aug 16 '22 20:08 bluecmd

Great, ty. If you can point me in the direction of the API documentation, I can try and help.

mwallace78 avatar Aug 16 '22 20:08 mwallace78

From what I'm seeing, /system/resource/usage is the API end point, same as other session information: "Resource to get usage data for [cpu|mem|disk|session|session6|setuprate|setuprate6|disk_lograte|faz_lograte|forticloud_lograte]."

In this case, I'm looking for 'setuprate', but if someone is going to add this to the exporter, including setup-rate6 wouldn't be a bad thing to have for people who need it.

mwallace78 avatar Aug 16 '22 22:08 mwallace78

@mwallace78 from what I can see the monitor API currently doesn't support that.

lazyb0nes avatar Nov 26 '23 10:11 lazyb0nes

I finally have access to the API documentation and I was able to validate that the following API end point does in fact return what I'm looking for: /api/v2/monitor/system/resource/usage?resource=setuprate&interval=1-min&&vdom=*

I took a brief look at the code and it looks like some of the bones to have this implemented are in place, but I am not well versed in Go and not sure how big of a lift to get this and setuprate6 would be to get fully implemented.

mwallace78 avatar Apr 08 '24 15:04 mwallace78