Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Volodymyr Melnyk
snmp_stats
Commits
511d57a4
Commit
511d57a4
authored
Nov 26, 2018
by
Volodymyr Melnyk
Browse files
This is fine.
parent
1a09c007
Changes
4
Hide whitespace changes
Inline
Side-by-side
bin/install.sh
0 → 100644
View file @
511d57a4
#!/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"
lib/common.sh
View file @
511d57a4
...
...
@@ -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"
share/sudoers/save_io_stats
0 → 100644
View file @
511d57a4
nobody ALL = NOPASSWD: /usr/sbin/iotop -d 10 -n 2 -k -b -a -o -P
share/systemd/save_io_stats.service
0 → 100644
View file @
511d57a4
[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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment