SSH_AGENT_PID remove superfluous grep, added print_psi to send()
This commit is contained in:
parent
23ab5a2371
commit
e18e94bb23
@ -61,7 +61,7 @@ get_ssh_agent () {
|
|||||||
for dir in /tmp/ssh-*; do
|
for dir in /tmp/ssh-*; do
|
||||||
if [[ -O ${dir} ]]; then
|
if [[ -O ${dir} ]]; then
|
||||||
# only choose the last agent
|
# only choose the last agent
|
||||||
export SSH_AGENT_PID=$(ps -eaf | grep ssh-agent | grep -v grep | \
|
export SSH_AGENT_PID=$(ps -eaf | grep '[s]sh-agent' | \
|
||||||
grep ${user} | awk '{print $2}')
|
grep ${user} | awk '{print $2}')
|
||||||
export SSH_AUTH_SOCK=$(ls ${dir}/agent.* | tail -1)
|
export SSH_AUTH_SOCK=$(ls ${dir}/agent.* | tail -1)
|
||||||
fi
|
fi
|
||||||
@ -186,11 +186,12 @@ send () {
|
|||||||
subj="PSI on ${host} ${psi_type} triggered!"
|
subj="PSI on ${host} ${psi_type} triggered!"
|
||||||
current_alarms="${psi_type}"
|
current_alarms="${psi_type}"
|
||||||
fi
|
fi
|
||||||
|
print_psi "${psi_type}" >> ${email}
|
||||||
|
printf "\n\n" >> ${email}
|
||||||
# is this an email or SMS?
|
# is this an email or SMS?
|
||||||
if [[ ! "${dst}" =~ "@${sms_domain}" ]]; then
|
if [[ ! "${dst}" =~ "@${sms_domain}" ]]; then
|
||||||
for p in $(tr '|' ' ' <<< "${current_alarms}"); do
|
for p in $(tr '|' ' ' <<< "${current_alarms}"); do
|
||||||
printf "\nStatistics info for ${p}\n\n" >> ${email}
|
printf "\n\nStatistics info for ${p}\n\n" >> ${email}
|
||||||
print_stats "${p}" >> ${email}
|
print_stats "${p}" >> ${email}
|
||||||
printf "\n\n" >> ${email}
|
printf "\n\n" >> ${email}
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user