User Tools

Site Tools


cgi_monitor_script
  • root@mailx:/home/system# cat first.cgi
  • #!/bin/bash
  • echo “Content-type: text/html”
  • echo “”
  • echo “<head><title>Bash as CGI" * echo "</title></head><body>" * * echo "<h1>General system information for host $(hostname -s)</h1>" * echo "" * * echo "<h1>Memory Info</h1>" * echo "<pre> $(free -m) </pre>" * * echo "<h1>Disk Info:</h1>" * echo "<pre> $(df -h) </pre>" * * echo "<h1>Logged in user</h1>" * echo "<pre> $(w) </pre>" * * echo "<h1>Hardware INFO</h1>" * echo "<pre> $(lscpu) </pre>" * * echo "<h1>Interface Status</h1>" * echo "<pre> $(ip -s link) </pre>" * * echo "<h1>TCP Status</h1>" * echo "<pre> $(netstat | grep SYN_RECV) </pre>" * echo "<pre> $(netstat | grep TIME_WAIT) </pre>" * * echo "<h1>System's resource usage </h1>" * echo "<pre> $(ps -A) </pre>" * * echo "<center>Information generated on $(date)</center>" * echo "</body>
cgi_monitor_script.txt · Last modified: 2023/03/06 11:31 by 127.0.0.1