脚本文件:
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="users" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Usrs
</a>
<div class="dropdown-menu" aria-labelledby="users">
<a class="dropdown-item" href="#">u1</a>
<a class="dropdown-item" href="#">u2</a>
<a class="dropdown-item" href="#">u3</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="tickets" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Tickets
</a>
<div class="dropdown-menu" aria-labelledby="tickets">
<a class="dropdown-item" href="#">t1</a>
<a class="dropdown-item" href="#">t2</a>
<a class="dropdown-item" href="#">t3</a>
</div>
</li>
</ul>
</div>
</nav>
下一个crontab -e
#script.sh
#!/BIN/BASH
# To alert whenever lsof crosses 80%
maxlimit=32000
echo 'Max limit is ' $maxlimit
tlimit=$(bc <<< $maxlimit*0.8)
echo 'Treshold limit at 80% ' $tlimit
a=$(lsof | wc -l)
echo 'Current usage ' $a
if [ $(bc <<< "$a > $tlimit") -eq 1 ]
then
echo 'lsof =' $a 'has exceeded 80% of maximum limit' | /usr/bin/Mail -s "ALERT!!!" "vsp@cisco.com"
fi
计划每分钟运行一次 但没有得到任何有关此
的细节