diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/Makefile.am | 3 | ||||
-rw-r--r-- | system/Makefile.in | 3 | ||||
-rw-r--r-- | system/netdata-freebsd.in | 48 | ||||
-rw-r--r-- | system/netdata.conf | 32 |
4 files changed, 75 insertions, 11 deletions
diff --git a/system/Makefile.am b/system/Makefile.am index b2e49c5af..255147bad 100644 --- a/system/Makefile.am +++ b/system/Makefile.am @@ -8,6 +8,7 @@ CLEANFILES = \ netdata.service \ netdata-init-d \ netdata-lsb \ + netdata-freebsd \ $(NULL) include $(top_srcdir)/build/subst.inc @@ -20,6 +21,7 @@ nodist_noinst_DATA = \ netdata.service \ netdata-init-d \ netdata-lsb \ + netdata-freebsd \ $(NULL) dist_noinst_DATA = \ @@ -28,5 +30,6 @@ dist_noinst_DATA = \ netdata.service.in \ netdata-init-d.in \ netdata-lsb.in \ + netdata-freebsd.in \ netdata.conf \ $(NULL) diff --git a/system/Makefile.in b/system/Makefile.in index ff19c9463..a9843de4f 100644 --- a/system/Makefile.in +++ b/system/Makefile.in @@ -273,6 +273,7 @@ CLEANFILES = \ netdata.service \ netdata-init-d \ netdata-lsb \ + netdata-freebsd \ $(NULL) SUFFIXES = .in @@ -282,6 +283,7 @@ nodist_noinst_DATA = \ netdata.service \ netdata-init-d \ netdata-lsb \ + netdata-freebsd \ $(NULL) dist_noinst_DATA = \ @@ -290,6 +292,7 @@ dist_noinst_DATA = \ netdata.service.in \ netdata-init-d.in \ netdata-lsb.in \ + netdata-freebsd.in \ netdata.conf \ $(NULL) diff --git a/system/netdata-freebsd.in b/system/netdata-freebsd.in new file mode 100644 index 000000000..fac2e82c2 --- /dev/null +++ b/system/netdata-freebsd.in @@ -0,0 +1,48 @@ +#!/bin/sh + +. /etc/rc.subr + +name=netdata +rcvar=netdata_enable + +pidfile="@localstatedir_POST@/run/netdata.pid" + +command="@sbindir_POST@/netdata" +command_args="-P ${pidfile}" + +required_files="@sysconfdir_POST@/netdata/netdata.conf" + +start_precmd="netdata_prestart" +stop_postcmd="netdata_poststop" + +extra_commands="reloadhealth savedb" + +reloadhealth_cmd="netdata_reloadhealth" +savedb_cmd="netdata_savedb" + +netdata_prestart() +{ + return 0 +} + +netdata_poststop() +{ + return 0 +} + +netdata_reloadhealth() +{ + p=`cat ${pidfile}` + kill -USR2 ${p} && echo "Sent USR2 (reload health) to pid ${p}" + return 0 +} + +netdata_savedb() +{ + p=`cat ${pidfile}` + kill -USR2 ${p} && echo "Sent USR1 (save db) to pid ${p}" + return 0 +} + +load_rc_config $name +run_rc_command "$1" diff --git a/system/netdata.conf b/system/netdata.conf index 6108d9086..7d7c54f42 100644 --- a/system/netdata.conf +++ b/system/netdata.conf @@ -1,14 +1,24 @@ -# NetData Configuration +# netdata configuration +# +# You can download the latest version of this file, using: +# +# wget -O /etc/netdata/netdata.conf http://localhost:19999/netdata.conf +# or +# curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf +# +# You can uncomment and change any of the options below. +# The value shown in the commented settings, is the default value. # -# To see defaults, grab one from your instance: -# http://localhost:19999/netdata.conf - -# global netdata configuration [global] - run as user = netdata - web files owner = root - web files group = netdata - # Netdata is not designed to be exposed to potentially hostile networks - # See https://github.com/firehol/netdata/issues/164 - bind to = localhost + run as user = netdata + + # the default database size - 1 hour + history = 3600 + + # by default do not expose the netdata port + bind to = localhost + +[web] + web files owner = root + web files group = netdata |