1.0.1
git-svn-id: svn://svn.code.sf.net/p/muninlite/code/muninlite@16 35caa317-6b62-4e8a-81c0-b04f0c356266
This commit is contained in:
parent
84fd994485
commit
6eb9e91c1f
|
@ -2,6 +2,12 @@ muninlite
|
|||
|
||||
Changelog:
|
||||
|
||||
1.0.1 - 1.0.1
|
||||
|
||||
Date: 2007-11-30
|
||||
|
||||
- Added ntpdate plugin
|
||||
|
||||
0.9.15 - 1.0.0
|
||||
|
||||
Date: 2007-06-20
|
||||
|
@ -37,4 +43,4 @@ Date: 2007-06-08
|
|||
- First Changelog
|
||||
- Initial "release"
|
||||
|
||||
|
||||
|
||||
|
|
9
Makefile
9
Makefile
|
@ -1,10 +1,11 @@
|
|||
|
||||
|
||||
PLUGINS=df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats
|
||||
PLUGINS=df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate
|
||||
#PLUGINS=cpu if_ if_err_ load memory processes netstat uptime interrupts irqstats
|
||||
|
||||
munin-node: plugins/*
|
||||
munin-node: plugins/* munin-node.conf
|
||||
@VERSION=$$(cat VERSION); \
|
||||
CONF=$$(grep -v '^#' munin-node.conf); \
|
||||
echo "Making munin-node for muninlite version $$VERSION"; \
|
||||
PLSTR=""; \
|
||||
for PLGIN in $(PLUGINS); \
|
||||
|
@ -16,7 +17,7 @@ munin-node: plugins/*
|
|||
-e 's/\//\\\//g' \
|
||||
-e 's/\$$/\\$$/g'); \
|
||||
perl -p -e \
|
||||
"s/\@\@VERSION\@\@/$$VERSION/;s/\@\@PLUGINS\@\@/$(PLUGINS)/;s/\@\@PLSTR\@\@/$$PLSTR/;" \
|
||||
"s/\@\@VERSION\@\@/$$VERSION/;s/\@\@CONF\@\@/$$CONF/;s/\@\@PLUGINS\@\@/$(PLUGINS)/;s/\@\@PLSTR\@\@/$$PLSTR/;" \
|
||||
munin-node.in > munin-node
|
||||
@chmod +x munin-node
|
||||
|
||||
|
@ -43,4 +44,4 @@ tgz: clean-node
|
|||
cd releases; \
|
||||
rm -rf muninlite-$$VERSION/releases; \
|
||||
tar zcvf muninlite-$$VERSION.tar.gz muninlite-$$VERSION >/dev/null; \
|
||||
rm -rf muninlite-$$VERSION;
|
||||
rm -rf muninlite-$$VERSION;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
#
|
||||
NTP_PEER="ntp.pool.org";
|
|
@ -14,8 +14,14 @@
|
|||
|
||||
VERSION="@@VERSION@@"
|
||||
|
||||
@@CONF@@
|
||||
|
||||
# Remove unwanted plugins from this list
|
||||
PLUGINS="@@PLUGINS@@"
|
||||
# ===== LIB FUNCTIONS =====
|
||||
clean_fieldname() {
|
||||
echo "$@" | sed -e 's/^[^A-Za-z_]/_/' -e 's/[^A-Za-z0-9_]/_/g'
|
||||
}
|
||||
|
||||
# ===== PLUGINS CODE =====
|
||||
@@PLSTR@@
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
config_ntpdate() {
|
||||
echo "graph_title NTP offset and dealy to peer $NTP_PEER"
|
||||
echo "graph_args --base 1000 --vertical-label msec"
|
||||
echo "offset.label Offset"
|
||||
echo "offset.draw LINE2"
|
||||
echo "delay.label Delay"
|
||||
echo "delay.draw LINE2"
|
||||
}
|
||||
|
||||
fetch_ntpdate() {
|
||||
NTPDATE="/usr/sbin/ntpdate"
|
||||
DATA=(0 0)
|
||||
if [ "$NTP_PEER" != "" ]; then
|
||||
if [ -x "$NTPDATE" ]; then
|
||||
DATA=($($NTPDATE -q $NTP_PEER | awk '/^server.*offset/{gsub(/,/,"");printf "%s %s", ($6*1000), ($8*1000);}'))
|
||||
fi
|
||||
fi
|
||||
echo "offset.value "${DATA[0]}
|
||||
echo "delay.value "${DATA[1]}
|
||||
}
|
||||
|
Loading…
Reference in New Issue