Commit 511d57a4 authored by Volodymyr Melnyk's avatar Volodymyr Melnyk

This is fine.

parent 1a09c007
#!/bin/sh
PATH=/bin
. /opt/snmp_stats/lib/common.sh
systemd_service_config='/etc/systemd/system/save_io_stats.service'
if [[ ! -f "${systemd_service_config}" ]]; then
log "Installing systemd service configuration file"
cat "${_share_dir}/systemd/save_io_stats.service" >"${systemd_service_config}"
fi
sudoers_config='/etc/sudoers.d/save_io_stats'
if [[ ! -f "${sudoers_config}" ]]; then
log "Installing sudoers configuration file"
cat "${_share_dir}/sudoers/save_io_stats" >"${sudoers_config}"
fi
io_stats_spool="${_spool_dir}/io"
if [[ ! -f "${io_stats_spool}" ]]; then
log "Creating the spool directory"
mkdir -p "${io_stats_spool}"
chown root:nobody "${io_stats_spool}"
chmod 0770 "${io_stats_spool}"
fi
log "Installation steps have been completed"
......@@ -7,4 +7,5 @@ _log_dir="${_root_dir}/log"
_var_dir="${_root_dir}/var"
_lock_dir="${_var_dir}/run"
_spool_dir="${_var_dir}/spool"
_share_dir="${_root_dir}/share"
_mib_root=".1.3.6.1.4.1.53033.100"
nobody ALL = NOPASSWD: /usr/sbin/iotop -d 10 -n 2 -k -b -a -o -P
[Unit]
Description=IO Stats Collector
[Service]
User=nobody
ExecStart=/opt/snmp_stats/bin/save_io_stats.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment