Skip to content

Commit

Permalink
added tests + improved help
Browse files Browse the repository at this point in the history
  • Loading branch information
omercier committed Feb 4, 2025
1 parent 9a2d9fd commit 00bad54
Show file tree
Hide file tree
Showing 7 changed files with 576 additions and 41 deletions.
6 changes: 3 additions & 3 deletions src/apps/haproxy/web/custom/api.pm
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ HAProxy web stats
=item B<--hostname>
IP Addr/FQDN of the web server host
IP address or FQDN of the HAProxy server.
=item B<--port>
Port used by web server
Port used by the web server
=item B<--proto>
Expand Down Expand Up @@ -200,7 +200,7 @@ Specify this option if you are accessing a web page using hidden basic authentic
=item B<--ntlmv2>
Specify this option if you are accessing a web page using ntlmv2 authentication (use with --credentials and --port options).
Specify this option if you are accessing a web page using NTLMv2 authentication (use with C<--credentials> and C<--port> options).
=item B<--timeout>
Expand Down
182 changes: 163 additions & 19 deletions src/apps/haproxy/web/mode/backendusage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -325,36 +325,180 @@ Also display and monitor Servers related to a given backend.
=item B<--filter-counters>
Only display some counters (regexp can be used).
Example: --filter-counters='^total-connections$'.
Define which counters should appear in the performance data (metrics).
This option will be treated as a regular expression.
Example: C<--filter-counters='^total-connections$'>.
=item B<--filter-name>
Filter Backend name (can be a regexp).
Define which backends should be monitored based on their names.
This option will be treated as a regular expression.
=item B<--warning-*-status>
=item B<--warning-backend-status>
Define the conditions to match for the status to be WARNING
where '*' can be: 'backend', 'server'.
Define the conditions to match for the backend status to be WARNING.
You can use the following variables: %{status}.
Example: --warning-backend-status='%{status} !~ /UP/i'
=item B<--critical-*-status>
Example: C<--warning-backend-status='%{status} !~ /UP/i'>
Define the conditions to match for the status to be CRITICAL (default: '%{status} !~ /UP/i')
where '*' can be: 'backend', 'server'.
You can use the following variables: %{status}.
Example: --critical-backend-status='%{status} !~ /UP/i'
=item B<--critical-backend-status>
Define the conditions to match for the backend status to be CRITICAL.
Default: C<'%{status} !~ /UP/i'>.
You can use the following variables: C<%{status}>.
Example: C<--critical-backend-status='%{status} !~ /UP/i'>
=item B<--warning-server-status>
Define the conditions to match for the server status to be WARNING.
You can use the following variables: C<%{status}>.
Example: C<--warning-backend-status='%{status} !~ /UP/i'>
=item B<--critical-server-status>
Define the conditions to match for the status to be CRITICAL. Default: C<'%{status} !~ /UP/i'>.
You can use the following variables: C<%{status}>.
Example: C<--critical-backend-status='%{status} !~ /UP/i'>
=item B<--warning-backend-current-queue>
Thresholds.
=item B<--critical-backend-current-queue>
Thresholds.
=item B<--warning-backend-current-session-rate>
Thresholds.
=item B<--critical-backend-current-session-rate>
Thresholds.
=item B<--warning-backend-max-session-rate>
Thresholds.
=item B<--critical-backend-max-session-rate>
Thresholds.
=item B<--warning-backend-current-sessions>
Thresholds.
=item B<--critical-backend-current-sessions>
Thresholds.
=item B<--warning-backend-total-sessions>
Thresholds.
=item B<--critical-backend-total-sessions>
Thresholds.
=item B<--warning-backend-traffic-in>
Thresholds in b/s.
=item B<--critical-backend-traffic-in>
Thresholds in b/s.
=item B<--warning-backend-traffic-out>
Thresholds in b/s.
=item B<--critical-backend-traffic-out>
Thresholds in b/s.
=item B<--warning-backend-denied-requests>
Thresholds.
=item B<--critical-backend-denied-requests>
Thresholds.
=item B<--warning-backend-denied-responses>
Thresholds.
=item B<--critical-backend-denied-responses>
Thresholds.
=item B<--warning-backend-connections-errors>
Thresholds.
=item B<--critical-backend-connections-errors>
Thresholds.
=item B<--warning-backend-responses-errors>
Thresholds.
=item B<--critical-backend-responses-errors>
Thresholds.
=item B<--warning-server-current-sessions>
Thresholds.
=item B<--critical-server-current-sessions>
Thresholds.
=item B<--warning-server-current-session-rate>
Thresholds.
=item B<--critical-server-current-session-rate>
Thresholds.
=item B<--warning-server-max-session-rate>
Thresholds.
=item B<--critical-server-max-session-rate>
Thresholds.
=item B<--warning-server-denied-responses>
Thresholds.
=item B<--critical-server-denied-responses>
Thresholds.
=item B<--warning-server-connections-errors>
Thresholds.
=item B<--critical-server-connections-errors>
Thresholds.
=item B<--warning-server-responses-errors>
Thresholds.
=item B<--warning-*> B<--critical-*>
=item B<--critical-server-responses-errors>
Thresholds.
Can be: 'backend-current-queue', 'backend-current-session-rate',
'backend-max-session-rate', 'backend-current-sessions', 'backend-total-sessions',
'backend-traffic-in' (b/s), 'backend-traffic-out' (b/s), 'backend-denied-requests', 'backend-denied-responses',
'backend-connections-errors', 'backend-responses-errors', 'server-current-sessions',
'server-current-session-rate', 'server-max-session-rate', 'server-denied-responses',
'server-connections-errors', 'server-responses-errors'
=back
Expand Down
Loading

0 comments on commit 00bad54

Please sign in to comment.