WIP: this should get the throughput and the nb of active sessions

This commit is contained in:
omercier 2024-09-13 16:03:44 +02:00
parent 9b5b90c736
commit 8605142e46
2 changed files with 75 additions and 7 deletions

View File

@ -217,6 +217,7 @@ sub manage_selection {
oper_mode => $result->{system}->{'operational-mode'}
};
# Result of `show system statistics session`
#Device is up : 40 days 5 hours 53 mins 12 sec
#Packet rate : 15872/s
#Throughput : 111588 Kbps
@ -224,13 +225,13 @@ sub manage_selection {
#Active TCP sessions : 5217
#Active UDP sessions : 7531
#Active ICMP sessions : 19
$result = $options{custom}->execute_command(command => 'show system statistics session', text_output => 1);
if ($result =~ /^Throughput\s*:\s*(\d+)\s+(..)/mi) {
$self->{system}->{throughput} = centreon::plugins::misc::convert_bytes(value => $1, unit => $2);
}
if ($result =~ /^Total\s+active\s+sessions\s*:\s*(\d+)/mi) {
$self->{system}->{active_sessions} = $1;
}
# This command is now only working in interactive mode (like top) and its output cannot be retrieved
# So instead of `show system statistics session` we'll be using `show session info` wich returns XML
$result = $options{custom}->execute_command(command => 'show session info');
$self->{system}->{throughput} = centreon::plugins::misc::convert_bytes(value => $result->{kbps}, unit => kbps);
$self->{system}->{active_sessions} = $result->{num-active};
$self->{cache_name} = 'paloalto_' . $self->{mode} . '_' . $options{custom}->get_hostname() . '_' .
(defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all'));

View File

@ -0,0 +1,67 @@
<response status="success"><result>
<age-accel-en>True</age-accel-en>
<age-accel-thresh>80</age-accel-thresh>
<age-accel-tsf>2</age-accel-tsf>
<age-scan-ssf>8</age-scan-ssf>
<age-scan-thresh>80</age-scan-thresh>
<age-scan-tmo>10</age-scan-tmo>
<cps>102</cps>
<dis-def>60</dis-def>
<dis-sctp>60</dis-sctp>
<dis-tcp>90</dis-tcp>
<dis-udp>60</dis-udp>
<hw-offload>False</hw-offload>
<hw-udp-offload>False</hw-udp-offload>
<icmp-unreachable-rate>200</icmp-unreachable-rate>
<ipv6-fw>True</ipv6-fw>
<kbps>85608</kbps>
<max-pending-mcast>0</max-pending-mcast>
<num-active>5619</num-active>
<num-bcast>0</num-bcast>
<num-gtpc>0</num-gtpc>
<num-gtpu-active>0</num-gtpu-active>
<num-gtpu-pending>0</num-gtpu-pending>
<num-http2-5gc>0</num-http2-5gc>
<num-icmp>7</num-icmp>
<num-imsi>0</num-imsi>
<num-installed>455057865</num-installed>
<num-max>199998</num-max>
<num-mcast>0</num-mcast>
<num-pfcpc>0</num-pfcpc>
<num-predict>0</num-predict>
<num-sctp-assoc>0</num-sctp-assoc>
<num-sctp-sess>0</num-sctp-sess>
<num-tcp>2623</num-tcp>
<num-udp>2989</num-udp>
<oor-action>drop</oor-action>
<pps>9476</pps>
<run-tc>True</run-tc>
<strict-checksum>True</strict-checksum>
<sw-cutthrough>True</sw-cutthrough>
<tcp-cong-ctrl>3</tcp-cong-ctrl>
<tcp-diff-syn-rej>True</tcp-diff-syn-rej>
<tcp-no-refresh-fin-rst>False</tcp-no-refresh-fin-rst>
<tcp-nonsyn-rej>True</tcp-nonsyn-rej>
<tcp-reject-siw-enable>False</tcp-reject-siw-enable>
<tcp-reject-siw-thresh>4</tcp-reject-siw-thresh>
<tcp-strict-rst>True</tcp-strict-rst>
<tmo-5gcdelete>15</tmo-5gcdelete>
<tmo-cp>30</tmo-cp>
<tmo-def>30</tmo-def>
<tmo-icmp>6</tmo-icmp>
<tmo-sctp>3600</tmo-sctp>
<tmo-sctpcookie>60</tmo-sctpcookie>
<tmo-sctpinit>5</tmo-sctpinit>
<tmo-sctpshutdown>30</tmo-sctpshutdown>
<tmo-tcp>3600</tmo-tcp>
<tmo-tcp-delayed-ack>25</tmo-tcp-delayed-ack>
<tmo-tcp-unverif-rst>30</tmo-tcp-unverif-rst>
<tmo-tcphalfclosed>120</tmo-tcphalfclosed>
<tmo-tcphandshake>10</tmo-tcphandshake>
<tmo-tcpinit>5</tmo-tcpinit>
<tmo-tcptimewait>15</tmo-tcptimewait>
<tmo-udp>30</tmo-udp>
<tunnel-accel>True</tunnel-accel>
<vardata-rate>10485760</vardata-rate>
<dp>*.dp0</dp>
</result></response>