#!/bin/bash

UPCNT=`ceph osd stat | head -1 | awk '{print $(NF-3)}'`
#OSDCNT=`ceph osd stat | awk '{print $(NF-5)}'`
OSDCNT=199 # 20160113

if [ !  $UPCNT == $OSDCNT ]; then
        echo "OSD DOWN!!!, OSD Total:$OSDCNT, OSD Current:$UPCNT"
else
        echo OSD_COUNT_OK
fi



# Disk fail Infomation
# Hostname              | total | cur   | failed-OSD
# SSD
# kinx-volume-ssd12-01  | 10    | 10    | 
# kinx-volume-ssd12-03  | 10    | 10    |
# kinx-volume-ssd12-05  | 10    | 10    |
# kinx-volume-ssd12-07  | 10    | 10    |
# kinx-volume-ssd12-09  | 8     | 8     |
# kinx-volume-ssd12-11  | 8     | 8     |
# kinx-volume-ssd24-02  | 20    | 18    | osd.55 osd.70
# kinx-volume-ssd24-04  | 20    | 20    |
# kinx-volume-ssd24-06  | 20    | 20    |
# kinx-volume-ssd24-08  | 20    | 19    | osd.112
#
# SATA
# kinx-volume-sata-01   | 10    | 10    |
# kinx-volume-sata-02   | 10    | 8     | osd.218, osd.212
# kinx-volume-sata-03   | 10    | 7     | osd.223, osd.123 osd.220
# kinx-volume-sata-04   | 10    | 9     | osd.230
# kinx-volume-sata-05   | 10    | 7     | osd.244, osd.124 osd.242
# kinx-volume-sata-06   | 10    | 10    |
# kinx-volume-sata-07   | 10    | 7     | osd.126, osd.125, osd.261
# kinx-volume-sata-08   | 10    | 8     | osd.270, osd.272 

# Journal Disk fail Information
# kinx-volume-ssd24-02 1EA |
# kinx-volume-ssd24-04 1EA | 
# kinx-volume-ssd24-06 2EA | 
