summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt16
-rw-r--r--Makefile2
-rwxr-xr-xbin/ceph-dns82
-rwxr-xr-xbin/ceph-info4
-rwxr-xr-xbin/ceph-log2
-rwxr-xr-xbin/ceph-remove-osd2
-rwxr-xr-xbin/cephfs-snap2
l---------share/ceph-info/web/ceph-health-detail.txt1
-rw-r--r--share/ceph-info/web/index.html3
-rw-r--r--share/cron/ceph-info2
-rw-r--r--share/man/Makefile2
-rw-r--r--share/man/ceph-info.1.txt2
-rw-r--r--share/man/ceph-log.1.txt2
-rw-r--r--share/man/ceph-remove-osd.1.txt2
-rw-r--r--share/man/cephfs-snap.1.txt2
-rw-r--r--share/man/storage-tools.7.txt2
16 files changed, 105 insertions, 23 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index f620881..13be2a3 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,3 +1,19 @@
+2018-09-15 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+
+ * Releasing version 20180915.
+
+ [ Daniel Baumann ]
+ * Updating default order of services in ceph-dns.
+ * Skipping unspecified services in ceph-dns from output.
+ * Some code cleanups in ceph-dns.
+ * Trimming output of ceph-dns.
+ * Stopping to hardcode final dot for zone entries in ceph-dns.
+ * Adding basic ipv4 address handling in ceph-dns.
+ * Adding master alternatives in ceph-dns.
+ * Adding SPDX License Identifiers.
+ * Adding ceph health detail in ceph-info page.
+ * Lowering default cronjob for ceph-info from 10 minutes to 2.
+
2017-11-01 Daniel Baumann <daniel.baumann@open-infrastructure.net>
* Releasing version 20171101.
diff --git a/Makefile b/Makefile
index c73b61e..d31901a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,8 @@
# storage-tools - Additional utilities to manage storage related tasks
# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
+# SPDX-License-Identifier: GPL-3.0+
+#
# 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 3 of the License, or
diff --git a/bin/ceph-dns b/bin/ceph-dns
index 4bf7a8f..59c5150 100755
--- a/bin/ceph-dns
+++ b/bin/ceph-dns
@@ -3,6 +3,8 @@
# storage-tools - Additional utilities to manage storage related tasks
# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
+# SPDX-License-Identifier: GPL-3.0+
+#
# 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 3 of the License, or
@@ -22,7 +24,7 @@ PROGRAM="$(basename ${0})"
Parameters ()
{
- GETOPT_LONGOPTIONS="number:,release:,zone:,with-reverse,with-round-robin,master:,mds:,mgr:,mon:,osd:,rgw:,"
+ GETOPT_LONGOPTIONS="number:,release:,zone:,ipv4-address:,with-reverse,with-round-robin,master:,mds:,mgr:,mon:,osd:,rgw:,"
GETOPT_OPTIONS="n:,r:,z:,f:,"
PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name=${PROGRAM} --options ${GETOPT_OPTIONS} --shell sh -- ${@})"
@@ -53,6 +55,11 @@ Parameters ()
shift 2
;;
+ --ipv4-address)
+ IPV4_ADDRESS="${2}"
+ shift 2
+ ;;
+
--with-reverse)
WITH_REVERSE="true"
shift 1
@@ -108,7 +115,7 @@ Parameters ()
Usage ()
{
- echo "Usage: ${PROGRAM} {create|check} [-n|--number NUMBER] [-r|--release RELEASE] [-z|--zone ZONE] [--with-reverse] [--with-round-robin] [--master MASTER_NUMBER] [--mds MDS_NUMBER] [--mgr MGR_NUMBER] [--mon MON_NUMBER] [--osd OSD_NUMBER] [--rgw RGW_NUMBER]" >&2
+ echo "Usage: ${PROGRAM} {create|check} [-n|--number NUMBER] [-r|--release RELEASE] [-z|--zone ZONE|none] [--ipv4-address IPV4_ADDRESS] [--with-reverse] [--with-round-robin] [--master MASTER_NUMBER] [--mds MDS_NUMBER] [--mgr MGR_NUMBER] [--mon MON_NUMBER] [--osd OSD_NUMBER] [--rgw RGW_NUMBER]" >&2
exit 1
}
@@ -132,7 +139,22 @@ Parameters "${@}"
NUMBER="${NUMBER:-3}"
RELEASE="${RELEASE:-luminous}"
-ZONE="${ZONE:-ceph.example.net}"
+
+case "${ZONE}" in
+ "")
+ ZONE=".ceph.example.net."
+ ;;
+
+ none)
+ ZONE=""
+ ;;
+
+ *)
+ ZONE=".${ZONE}"
+ ;;
+esac
+
+IPV4_ADDRESS="${IPV4_ADDRESS:-10.0.0.11}"
MASTER="${MASTER:-1}"
MDS="${MDS:-${NUMBER}}"
@@ -151,19 +173,24 @@ STATUS_BAD="${RED}✘${NORMAL}"
STATUS_UGLY="${WHITE}○${NORMAL}"
cat << EOF
-; Ceph DNS: Forward Entries for ${ZONE}
+; Ceph DNS: Forward Entries
EOF
# Run forward zone
-for SERVICE in master mds mgr mon osd rgw
+for SERVICE in master mon mgr mds rgw osd
do
NUMBERS="$(eval "echo \$$(echo "${SERVICE}" | tr [a-z] [A-Z])")"
+ if [ -z "${NUMBERS}" ]
+ then
+ continue
+ fi
+
for NUMBER in $(seq 1 ${NUMBERS})
do
case "${SERVICE}" in
master)
- CONTAINER="master"
+ CONTAINER="${SERVICE}"
;;
*)
@@ -173,7 +200,7 @@ do
case "${CHECK}" in
true)
- IP_ADDRESS="$(dig +short ${CONTAINER}.${RELEASE}.${ZONE} | tail -n1)"
+ IP_ADDRESS="$(dig +short ${CONTAINER}.${RELEASE}${ZONE} | tail -n1)"
if [ -n "${IP_ADDRESS}" ]
then
@@ -182,34 +209,42 @@ do
IP_ADDRESS="${STATUS_BAD}"
fi
;;
-
- *)
- IP_ADDRESS="FIXME"
- ;;
esac
+ case "${SERVICE}" in
+ master)
+
cat << EOF
-${CONTAINER}.${RELEASE}.${ZONE} IN A ${IP_ADDRESS}
-${CONTAINER}.${ZONE} IN CNAME ${CONTAINER}.${RELEASE}.${ZONE}.
+${CONTAINER}${ZONE} IN A ${IP_ADDRESS}
+dashboard${ZONE} IN CNAME master${ZONE}
+${ZONE} IN A ${IP_ADDRESS}
EOF
- case "${SERVICE}" in
- master)
;;
*)
+
+cat << EOF
+
+${CONTAINER}.${RELEASE}${ZONE} IN A ${IP_ADDRESS}
+${CONTAINER}${ZONE} IN CNAME ${CONTAINER}.${RELEASE}${ZONE}
+EOF
+
+
if [ "${WITH_ROUND_ROBIN}" = "true" ]
then
cat << EOF
-${SERVICE}.${RELEASE}.${ZONE} IN A ${IP_ADDRESS}
-${SERVICE}.${ZONE} IN A ${IP_ADDRESS}
+${SERVICE}.${RELEASE}${ZONE} IN A ${IP_ADDRESS}
+${SERVICE}${ZONE} IN A ${IP_ADDRESS}
EOF
fi
;;
esac
+
+ IP_ADDRESS="$((${IP_ADDRESS} + 1))"
done
done
@@ -218,15 +253,20 @@ case "${WITH_REVERSE}" in
cat << EOF
-; Ceph DNS: Reverse Entries for ${ZONE}
+; Ceph DNS: Reverse Entries
EOF
# Run reverse zone
- for SERVICE in master mds mgr mon osd rgw
+ for SERVICE in master mon mgr mds rgw osd
do
NUMBERS="$(eval "echo \$$(echo "${SERVICE}" | tr [a-z] [A-Z])")"
+ if [ -z "${NUMBERS}" ]
+ then
+ continue
+ fi
+
for NUMBER in $(seq 1 ${NUMBERS})
do
case "${SERVICE}" in
@@ -241,7 +281,7 @@ EOF
case "${CHECK}" in
true)
- IP_ADDRESS="$(dig +short ${CONTAINER}.${RELEASE}.${ZONE} | tail -n1)"
+ IP_ADDRESS="$(dig +short ${CONTAINER}.${RELEASE}${ZONE} | tail -n1)"
if [ -n "${IP_ADDRESS}" ]
then
@@ -263,7 +303,7 @@ EOF
esac
cat << EOF
-${IP_ADDRESS} IN PTR ${CONTAINER}.${RELEASE}.${ZONE}. ${STATUS}
+${IP_ADDRESS} IN PTR ${CONTAINER}.${RELEASE}${ZONE} ${STATUS}
EOF
done
diff --git a/bin/ceph-info b/bin/ceph-info
index 782772a..845e306 100755
--- a/bin/ceph-info
+++ b/bin/ceph-info
@@ -3,6 +3,8 @@
# storage-tools - Additional utilities to manage storage related tasks
# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
+# SPDX-License-Identifier: GPL-3.0+
+#
# 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 3 of the License, or
@@ -40,7 +42,7 @@ HOST="$(hostname -f)"
mkdir -p "/var/log/${SOFTWARE}/${PROGRAM}"
-for INFORMATION in ceph-status ceph-df ceph-osd-df ceph-osd-tree ceph-versions
+for INFORMATION in ceph-status ceph-health-detail ceph-df ceph-osd-df ceph-osd-tree ceph-versions
do
COMMAND="$(echo ${INFORMATION} | sed -e 's|-| |g')"
diff --git a/bin/ceph-log b/bin/ceph-log
index f06605f..1470101 100755
--- a/bin/ceph-log
+++ b/bin/ceph-log
@@ -3,6 +3,8 @@
# storage-tools - Additional utilities to manage storage related tasks
# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
+# SPDX-License-Identifier: GPL-3.0+
+#
# 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 3 of the License, or
diff --git a/bin/ceph-remove-osd b/bin/ceph-remove-osd
index 8c0f38a..1b16a47 100755
--- a/bin/ceph-remove-osd
+++ b/bin/ceph-remove-osd
@@ -3,6 +3,8 @@
# storage-tools - Additional utilities to manage storage related tasks
# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
+# SPDX-License-Identifier: GPL-3.0+
+#
# 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 3 of the License, or
diff --git a/bin/cephfs-snap b/bin/cephfs-snap
index 52548d3..d6bb96d 100755
--- a/bin/cephfs-snap
+++ b/bin/cephfs-snap
@@ -3,6 +3,8 @@
# storage-tools - Additional utilities to manage storage related tasks
# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
+# SPDX-License-Identifier: GPL-3.0+
+#
# 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 3 of the License, or
diff --git a/share/ceph-info/web/ceph-health-detail.txt b/share/ceph-info/web/ceph-health-detail.txt
new file mode 120000
index 0000000..e78c3e7
--- /dev/null
+++ b/share/ceph-info/web/ceph-health-detail.txt
@@ -0,0 +1 @@
+/var/log/storage-tools/ceph-info/ceph-health-detail.txt \ No newline at end of file
diff --git a/share/ceph-info/web/index.html b/share/ceph-info/web/index.html
index eeea131..491db2d 100644
--- a/share/ceph-info/web/index.html
+++ b/share/ceph-info/web/index.html
@@ -47,6 +47,9 @@
<h2>$ ceph status</h2>
<p><iframe src="ceph-status.txt" frameborder="0" height="400" width="95%"></iframe></p>
+ <h2>$ ceph health detail</h2>
+ <p><iframe src="ceph-df.txt" frameborder="0" height="250" width="95%"></iframe></p>
+
<h2>$ ceph df</h2>
<p><iframe src="ceph-df.txt" frameborder="0" height="250" width="95%"></iframe></p>
diff --git a/share/cron/ceph-info b/share/cron/ceph-info
index 9041e34..37c4312 100644
--- a/share/cron/ceph-info
+++ b/share/cron/ceph-info
@@ -1 +1 @@
-*/10 * * * * root [ -e /usr/bin/ceph-info ] && /usr/bin/ceph-info
+*/2 * * * * root [ -e /usr/bin/ceph-info ] && /usr/bin/ceph-info
diff --git a/share/man/Makefile b/share/man/Makefile
index 03b5914..101186e 100644
--- a/share/man/Makefile
+++ b/share/man/Makefile
@@ -3,6 +3,8 @@
# storage-tools - Additional utilities to manage storage related tasks
# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
+# SPDX-License-Identifier: GPL-3.0+
+#
# 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 3 of the License, or
diff --git a/share/man/ceph-info.1.txt b/share/man/ceph-info.1.txt
index 72c50b1..cf9088a 100644
--- a/share/man/ceph-info.1.txt
+++ b/share/man/ceph-info.1.txt
@@ -1,6 +1,8 @@
// storage-tools - Additional utilities to manage storage related tasks
// Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
//
+// SPDX-License-Identifier: GPL-3.0+
+//
// 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 3 of the License, or
diff --git a/share/man/ceph-log.1.txt b/share/man/ceph-log.1.txt
index 997db04..16c39d8 100644
--- a/share/man/ceph-log.1.txt
+++ b/share/man/ceph-log.1.txt
@@ -1,6 +1,8 @@
// storage-tools - Additional utilities to manage storage related tasks
// Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
//
+// SPDX-License-Identifier: GPL-3.0+
+//
// 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 3 of the License, or
diff --git a/share/man/ceph-remove-osd.1.txt b/share/man/ceph-remove-osd.1.txt
index 28b6062..81d35ae 100644
--- a/share/man/ceph-remove-osd.1.txt
+++ b/share/man/ceph-remove-osd.1.txt
@@ -1,6 +1,8 @@
// storage-tools - Additional utilities to manage storage related tasks
// Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
//
+// SPDX-License-Identifier: GPL-3.0+
+//
// 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 3 of the License, or
diff --git a/share/man/cephfs-snap.1.txt b/share/man/cephfs-snap.1.txt
index 06b1ab7..2e98bf3 100644
--- a/share/man/cephfs-snap.1.txt
+++ b/share/man/cephfs-snap.1.txt
@@ -1,6 +1,8 @@
// storage-tools - Additional utilities to manage storage related tasks
// Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
//
+// SPDX-License-Identifier: GPL-3.0+
+//
// 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 3 of the License, or
diff --git a/share/man/storage-tools.7.txt b/share/man/storage-tools.7.txt
index a5133d1..78a9182 100644
--- a/share/man/storage-tools.7.txt
+++ b/share/man/storage-tools.7.txt
@@ -1,6 +1,8 @@
// storage-tools - Additional utilities to manage storage related tasks
// Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
//
+// SPDX-License-Identifier: GPL-3.0+
+//
// 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 3 of the License, or