How to send the content of a file to a port on a UNIX box
Decide what port to use, and add this to /etc/services so for example:
/etc/services ..
syslog_monitor 5556/tcp (note no blank lines, and a tab)
Then add this in as a service in inetd.conf, like this..:
/etc/inet/inetd.conf
syslog_monitor stream tcp nowait nobody /usr/local/bin/syslog_monitor
syslog_monitor
Then the script...
# cat /usr/local/bin/syslog_monitor
#! /bin/sh
/bin/tail -f /var/adm/messages
Once all that has been done, then restart inetd and anything new sent to the file will also get sent to the port.
|