[CUWiN-Dev] feature request

Bill Comisky bcomisky at pobox.com
Tue Feb 1 22:55:23 CST 2005


Attached is a patch against r2622 of src/ that implements Stephane's 
nodeinfo script.  I added the output of 'uname -a' and 'arp -na'. 
wlanctl output would be useful too.  The port is set to 5000 now, edit as 
you like.

p.s. Thanks for the mkstaboot step-wise build stuff Dave, nearly instant 
gratification now.

bill

--
Bill Comisky
bcomisky at pobox.com

On Sun, 30 Jan 2005, Stephane Alnet wrote:

>> It would be nice if our web interface included a link to a page that
>> simply reported a bunch of information about the node such as it's
>> ifconfig -a and netstat -rn output and any other data we have easy
>> access to.
>
> Again..
>
>> !/bin/sh
>> nodeinfo.sh
>
> cat <<HEADER_END
> HTTP/1.1 200 OK
> Connection: close
> Content-Type: text/plain
> Expire: 60
>
> HEADER_END
>
> echo
> echo "------ /sbin/ifconfig -a -----"
> echo
> /sbin/ifconfig -a
>
> echo
> echo "------ /sbin/netstat -rn -----"
> echo
> /usr/sbin/netstat -rn
>
> # At EOF (nodeinfo.sh)
>
> In inetd.conf:
> some-port \t stream \t tcp \t nowait \t nobody \t location-of-nodeinfo.sh
> +add "some-port" to /etc/services
> +link to http://localnode:some-port/ in webpage
>
> (And no, Dave, I won't get the whole svn tree just to submit this.)
> S.
>
-------------- next part --------------
Index: boot-image/etc-patches/patch-services
===================================================================
--- boot-image/etc-patches/patch-services	(revision 2622)
+++ boot-image/etc-patches/patch-services	(working copy)
@@ -1,6 +1,6 @@
 --- etc/services	2004-05-07 00:43:37.000000000 -0500
-+++ etc/services	2004-06-01 03:38:01.000000000 -0500
-@@ -368,3 +368,7 @@
++++ etc/services	2005-02-01 03:38:01.000000000 -0500
+@@ -368,3 +368,8 @@
  zephyr-clt      2103/udp                        # Zephyr serv-hm connection
  zephyr-hm       2104/udp                        # Zephyr hostmanager
  zephyr-hm-srv   2105/udp                        # Zephyr hm-serv connection
@@ -8,3 +8,4 @@
 +# C-U Wireless numbers.
 +etx             9090/udp                        # Estimated Transmission Count
 +hsls            9191/udp                        # Hazy Sighted Link State
++nodeinfo        5000/tcp                        # nodeinfo script
Index: boot-image/etc-patches/patch-inetd.conf
===================================================================
--- boot-image/etc-patches/patch-inetd.conf	(revision 0)
+++ boot-image/etc-patches/patch-inetd.conf	(revision 0)
@@ -0,0 +1,11 @@
+--- etc/inetd.conf	2004-01-31 15:51:53.000000000 -0600
++++ etc/inetd.conf	2005-02-01 14:38:46.000000000 -0600
+@@ -26,6 +26,8 @@
+ #comsat		dgram	udp6	wait	root	/usr/libexec/comsat	comsat
+ #ntalk		dgram	udp	wait	nobody:tty	/usr/libexec/ntalkd	ntalkd
+ #bootps		dgram	udp	wait	root	/usr/sbin/bootpd	bootpd
++nodeinfo	stream	tcp	nowait	nobody	/usr/bin/nodeinfo.sh	nodeinfo.sh
++nodeinfo	stream	tcp6	nowait	nobody	/usr/bin/nodeinfo.sh	nodeinfo.sh
+ #
+ #	Games
+ #
Index: boot-image/etc-patches/patch-rc.conf
===================================================================
--- boot-image/etc-patches/patch-rc.conf	(revision 2622)
+++ boot-image/etc-patches/patch-rc.conf	(working copy)
@@ -46,8 +46,8 @@
 + #
 + savecore=NO
 + 
-+ # Don't run it yet.
-+ inetd=NO
++ # try this for nodeinfo script
++ inetd=YES
 + 
 + ipfilter=YES					# uses /etc/ipf.conf
 + ipnat=YES					# uses /etc/ipnat.conf
Index: boot-image/extras/extraslog
===================================================================
--- boot-image/extras/extraslog	(revision 2622)
+++ boot-image/extras/extraslog	(working copy)
@@ -63,6 +63,8 @@
 ./usr/share type=dir mode=0755 uname=root gname=wheel
 ./usr/share/misc type=dir mode=0755 uname=root gname=wheel
 ./usr/share/misc/termcap type=file mode=0644 uname=root gname=wheel
+./usr/bin type=dir mode=0755 uname=root gname=wheel
+./usr/bin/nodeinfo.sh type=file mode=0755 uname=root gname=wheel
 ./var type=dir mode=0755 uname=root gname=wheel
 ./var/core type=dir mode=01777 uname=root gname=wheel
 ./var/db type=dir mode=0755 uname=root gname=wheel
Index: boot-image/extras/usr/bin/nodeinfo.sh
===================================================================
--- boot-image/extras/usr/bin/nodeinfo.sh	(revision 0)
+++ boot-image/extras/usr/bin/nodeinfo.sh	(revision 0)
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+cat <<HEADER_END
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/plain
+Expire: 60
+
+HEADER_END
+
+echo
+echo "------ /usr/bin/uname -a -----"
+echo
+/usr/bin/uname -a
+
+echo
+echo "------ /sbin/ifconfig -a -----"
+echo
+/sbin/ifconfig -a
+
+echo
+echo "------ /usr/bin/arp -na -----"
+echo
+/usr/sbin/arp -na
+
+echo
+echo "------ /usr/bin/netstat -rn -----"
+echo
+/usr/bin/netstat -rn -f inet
+/usr/bin/netstat -rn -f inet6

Property changes on: boot-image/extras/usr/bin/nodeinfo.sh
___________________________________________________________________
Name: svn:executable
   + *



More information about the CU-Wireless-Dev mailing list