SNTOP(1)

πŸ‘‘ SNTOP(1) πŸ‘‘

okay bestie, pull up a chair, because we're about to read the manual page for sntop(1) β€” and honestly? it's giving essential.


✨ NAME ✨

sntop β€” a top-like console network status tool πŸ¦‹


🌸 SYNOPSIS 🌸

sntop [options]

πŸ’– DESCRIPTION πŸ’–

so sntop (simple nettop, iconic name honestly) is a console utility that lives in the same spiritual lane as top. what it does is poll a whole list of hosts on a regular interval to figure out if they're online, and then it shows you all of that in a cute little formatted table. πŸ’…

that list? it gets read on load from a config file called sntoprc, which lives (by default) in ~/ or /etc. and the polling itself is done via ICMP ping(1). no cap.

optionally β€” and this is the fun part β€” the results can be used to generate an html page, or to elicit the execution of a file. main character energy fr fr.

there are also interactive run-time commands, and yes you use them while it's running:

  • q β€” quit πŸ‘‹
  • r β€” reload config file πŸ”„
  • w β€” toggle html page generation 🌐
  • any other key β€” force a refresh ⚑

πŸŽ€ COMMAND-LINE PARAMETERS πŸŽ€

  • -d, --daemon β€” daemon mode: makes sntop capable of running in the background. note, it won't automatically fork into the background. πŸ™ˆ
  • -o, --once β€” poll and display results once, then exit. one and done, we love a quickie. ✨
  • -c, --nocolor β€” toggle the use of ncurses color for pretty formatting. sometimes you want the aesthetic, sometimes you don't. 🎨
  • -p, --ping β€” use ping in lieu of fping. note, ping (in particular on DOWN hosts) is slower than fping β€” the performance of sntop will suffer. 😭 so like... know what you're signing up for.
  • -w, --html β€” generate html output of results. she's got range. 🌈
  • -s, --secure β€” secure mode. command keys are disabled. SIGINT must be used to terminate the program. this allows sntop to run nicely on spare terminals galore. something like the following in /etc/passwd can facilitate that:
sntop:x:123:123:sntop:/:/usr/local/bin/sntop -s
  • -e <file>, --wfile=file β€” output html to <file> instead of sntop.html
  • -f <file>, --conf=file β€” read conf data from <file> instead of ~/.sntoprc. note, sntop will still try to read from /etc/sntoprc if <file> fails. if both fail, sntop will exit. πŸ’€
  • -r <time>, --refresh=time β€” refresh every <time> seconds instead of 180
  • -a <file>, --alarm=file β€” alarm mode: execute <file> when a site first goes DOWN. 🚨
  • -l <file>, --log=file β€” log mode: execute <file> whenever the status of a site changes
  • -b <bytes>, --byte=bytes β€” Number of bytes of ping data to send
  • -v, --version β€” display version information and exit
  • -h, --help β€” display command-syntax help and exit

🧚 Command Execution Syntax 🧚

in alarm or log mode, a file gets executed on the occurrence of a change in status of a given host. sntop will fork and exec the specified file, passing as arguments information about the event. and those arguments are, in order:

<display name of host> <host name/IP> <status>

let's break that down, bestie:

  • <display name of host> β€” the 'display' name (the first sntop column) of the machine, ie "MyBox"
  • <host name/IP> β€” the explicit hostname or IP address of the machine, ie "snaggle" or "192.168.55.12"
  • <status> β€” the new status of the machine, "UP" or "DOWN," this would obviously always be DOWN for alarm mode
note, DOWN hosts will be logged in both modes upon load (ie, if they are down when sntop loads, <file> is executed). No action is taken in any modes for hosts that originate as UP β€” thus, the default status is UP. πŸ‘‘

and the reason it works this way? we execute an external file to remain in the UNIX tradition β€” small, simple programs that do one thing damn well. thus, a logging option is not even provided β€” a two-line shell script will do fine, there. however, the possibilities are powerful: administrator paging, for instance. See alarm.sh for an example script. 🫢


🌼 FILES 🌼

  • ~/.sntoprc β€” default config file location
  • /etc/sntoprc β€” if a user's config is not found, this system-wide one is read
  • /usr/share/man/man1/sntop.1.gz β€” the man page (hi, that's me, you're reading me πŸ’…)
  • /usr/share/doc/sntop/examples/alarm.sh β€” sample alarm-execute script
  • /usr/bin/sntop β€” the sntop executable

πŸ“ CONFIG FILE πŸ“

An example config file, /usr/share/doc/sntop/examplessntoprc.EXAMPLE, is included in the standard distribution. however, the config file syntax is simple. entries are RETURN terminated. trailing whitespace is ignored. '#' signifies a comment and can be used inline. by default, upto 32 characters will be read, per line. all entries should be a single word, except comments. the syntax:

Display Name
IP or host
Display Comments

Example:

Jimi
192.168.23.1
linux/sparc; firewall, http, ftp

and here's the load order, no cap: sntop will first attempt to read the config file from ~/.sntoprc (or another location specified by -f). If that fails, the system config file will be read from /etc/sntoprc. If both fail, sntop will exit. 😭


πŸ’œ AUTHORS πŸ’œ

sntop was written by Robert M. Love <rml@tech9.net> and Christopher M. Rivera <cmrivera@ufl.edu>. Send us bug reports, suggestions, and hardware. (yes, hardware. they said what they said. 🎁)


⭐ SEE ALSO ⭐

top(1), ping(1), fping(1)


and that's the whole page, bestie!! this one's the SNTOP(1) manual, dated October 22, 2008 β€” a certified classic from the sntop source distribution, and honestly it ate. go forth and ping responsibly. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from