~1chb1n/charms/trusty/ceph-osd/15.10-stable-flip-tests-helper-syncs

« back to all changes in this revision

Viewing changes to files/nagios/collect_ceph_status.sh

  • Committer: Liam Young
  • Date: 2015-01-12 17:24:51 UTC
  • mfrom: (31.1.8 ceph-osd)
  • Revision ID: liam.young@canonical.com-20150112172451-tcckwobla60wsyls
[gnuoy,r=james-page] Add support for nrpe

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
# Copyright (C) 2014 Canonical
 
3
# All Rights Reserved
 
4
# Author: Jacek Nykis <jacek.nykis@canonical.com>
 
5
 
 
6
LOCK=/var/lock/ceph-status.lock
 
7
lockfile-create -r2 --lock-name $LOCK > /dev/null 2>&1
 
8
if [ $? -ne 0 ]; then
 
9
    exit 1
 
10
fi
 
11
trap "rm -f $LOCK > /dev/null 2>&1" exit
 
12
 
 
13
DATA_DIR="/var/lib/nagios"
 
14
if [ ! -d $DATA_DIR ]; then
 
15
    mkdir -p $DATA_DIR
 
16
fi
 
17
 
 
18
ceph status >${DATA_DIR}/cat-ceph-status.txt