Change EPS for Telegraf

This commit is contained in:
Mike Reeves
2021-04-19 12:36:46 -04:00
parent af7b6af32f
commit 31f193c397
14 changed files with 255 additions and 263 deletions

View File

@@ -15,19 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
APP=raid
lf=/tmp/$APP-pidLockFile
# create empty lock file if none exists
cat /dev/null >> $lf
read lastPID < $lf
# if lastPID is not null and a process with that pid exists , exit
[ ! -z "$lastPID" -a -d /proc/$lastPID ] && exit
echo $$ > $lf
RAIDLOG=/var/log/raid/status.log
RAIDSTATUS=$(cat /var/log/raid/status.log)
THEGREP=$(ps -ef | grep $0 | grep -v grep)
if [ -f "$RAIDLOG" ]; then
echo "raid $RAIDSTATUS"
if [ ! $THEGREP ]; then
if [ -f "$RAIDLOG" ]; then
echo "raid $RAIDSTATUS"
else
exit 0
fi
else
exit 0
fi