Commit f31a2c08 authored by Volodymyr Melnyk's avatar Volodymyr Melnyk

Fix another bug

parent d240faa8
#!/bin/bash
PATH=/bin
PATH=/bin:/usr/bin
. /opt/snmp_stats/lib/common.sh
......@@ -12,7 +12,7 @@ req="${2}"
_log_file="${_log_dir}/snmp_io_stats.log"
_log 1 "${act} ${req} requested"
_log 0 "${act} ${req} requested"
instance_number="${req#${mib}}"
instance_number="${instance_number#.}"
......@@ -43,4 +43,3 @@ if [[ -f "${io_stats_dir}/${instance_number}" ]]; then
echo "integer"
echo "$(printf '%0.f' "${io_stats_w}")"
fi
......@@ -8,8 +8,8 @@ _log_dir="${_var_dir}/log"
_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"
_log_file="${_log_dir}/snmp_stats.log"
_mib_root=".1.3.6.1.4.1.53033.100"
trap "exit ${_exit_status_error}" TERM
_top_pid="${$}"
......
......@@ -10,30 +10,32 @@ if [[ ! -f "${_log_dir}" ]]; then
chmod 0770 "${_log_dir}"
fi
_log_file='/dev/null'
systemd_service_config='/etc/systemd/system/save_io_stats.service'
if [[ ! -f "${systemd_service_config}" ]]; then
_log 0 "Installing systemd service configuration file"
_log 1 "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 0 "Installing sudoers configuration snippet"
_log 1 "Installing sudoers configuration snippet"
cat "${_share_dir}/sudoers/save_io_stats" >"${sudoers_config}"
fi
logrotate_config='/etc/logrotate.d/snmp_stats'
if [[ ! -f "${logrotate_config}" ]]; then
_log 0 "Installing logrotate configuration snippet"
_log 1 "Installing logrotate configuration snippet"
cat "${_share_dir}/logrotate/snmp_stats" >"${logrotate_config}"
fi
io_stats_spool="${_spool_dir}/io"
if [[ ! -f "${io_stats_spool}" ]]; then
_log 0 "Creating the spool directory"
_log 1 "Creating the spool directory"
mkdir -p "${io_stats_spool}"
chown root:nobody "${io_stats_spool}"
chmod 0770 "${io_stats_spool}"
fi
_log 0 "Installation steps have been completed"
_log 1 "Installation steps have been completed"
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