From c23fd583f0d5b2ab4ce6801484aae6666102a4c3 Mon Sep 17 00:00:00 2001 From: Jack-Benny Persson Date: Mon, 23 Jan 2012 06:01:51 +0100 Subject: [PATCH] Add first file --- check_gputemp.sh | 236 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100755 check_gputemp.sh diff --git a/check_gputemp.sh b/check_gputemp.sh new file mode 100755 index 0000000..5097966 --- /dev/null +++ b/check_gputemp.sh @@ -0,0 +1,236 @@ +#!/bin/bash + +################################################################################ +# # +# Copyright (C) 2011 Jack-Benny Persson # +# # +# This program is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +################################################################################ + +############################################################################### +# # +# Nagios plugin to monitor GPU temperature with aticonfig. # +# This only works on ATI cards with the proprietary driver (fglrx). # +# Written in Bash (and uses sed & awk). # +# # +############################################################################### + +VERSION="Version 1.0" +AUTHOR="(c) 2011 Jack-Benny Persson (jack-benny@cyberinfo.se)" + +# Sensor program +SENSORPROG=/usr/bin/aticonfig + +# Exit codes +STATE_OK=0 +STATE_WARNING=1 +STATE_CRITICAL=2 +STATE_UNKNOWN=3 + +shopt -s extglob + +#### Functions #### + +# Print version information +print_version() +{ + printf "\n\n$0 - $VERSION\n" +} + +#Print help information +print_help() +{ + print_version + printf "$AUTHOR\n" + printf "Monitor GPU temperatur with the use of aticonfig (fglrx)\n" +/bin/cat <