File: showtimeout.sh

package info (click to toggle)
prometheus-script-exporter 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 336 kB
  • sloc: makefile: 51; sh: 41
file content (22 lines) | stat: -rwxr-xr-x 798 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash

echo "# HELP script_has_timeout Whether this script is run with a timeout."
echo "# TYPE script_has_timeout gauge"
if [ -z "$SCRIPT_TIMEOUT" ]; then
	echo "script_has_timeout{} 0"
	exit 0
fi
echo "script_has_timeout{} 1"

echo "# HELP script_timeout_seconds Timeout of the script in seconds"
echo "# TYPE script_timeout_seconds gauge"
echo "script_timeout_seconds{} $SCRIPT_TIMEOUT"

echo "# HELP script_deadline_seconds Unix timestamp when the timeout will expire"
echo "# TYPE script_deadline_seconds gauge"
echo "script_deadline_seconds{} $SCRIPT_DEADLINE"

echo "# HELP script_timeout_enforced Whether or not script_exporter is enforcing a timeout on the script."
echo "# TYPE script_timeout_enforced gauge"
echo "script_timeout_enforced{} $SCRIPT_TIMEOUT_ENFORCED"
exit 0