2d275 SysInfo: a set of scripts that document your system - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Development > Userland Programming & Scripting

Userland Programming & Scripting C, C++, Python, Perl, Shell, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old April 8th, 2009, 17:34
danger@'s Avatar
danger@ danger@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Bratislava, Slovakia
Posts: 774
Thanks: 4
Thanked 167 Times in 84 Posts
Lightbulb SysInfo: a set of scripts that document your system

Hello guys,

I am developing a script that automatically documents settings of particular freebsd (currently 7.x) box from the hardware point of view to the network and services related information.

The point of this script is to provide some descriptive information about unknown system's configuration (hardware and software) for administrator who has no idea about the given system.

I would greatly appreciate if you guys could test it in your environment and provide some feedback. It currently doesn't provide very much information, so I would really also like to hear your opinions on what kind of information would you be interested in in above described situation, which I should document.

The latest version of this script can be found at:
http://people.freebsd.org/~danger/sysinfo/

Thank you.
__________________
Looking for administrator? http://www.syscare.sk
Reply With Quote
The Following 4 Users Say Thank You to danger@ For This Useful Post:
fender0107401 (April 21st, 2009), hbokh (April 19th, 2009), mfaridi (April 15th, 2009), tingo (July 15th, 2011)
  #2  
Old April 8th, 2009, 17:44
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,935
Thanks: 30
Thanked 1,932 Times in 1,351 Posts
Default

I get an error in the part handled by the 020-mem script.

Code:
System memory summary
expr: illegal option -- 4
usage: expr [-e] expression
expr: illegal option -- 1
usage: expr [-e] expression
Total real memory available:	2047 MB
Logically used memory:		 MB
Logically available memory:	 MB
020-mem run with sh -xv:

Code:
cat <<EOF
Total real memory available:	$(calc_mb $physmem) MB
Logically used memory:		$(calc_mb $usedmem) MB
Logically available memory:	$(calc_mb $availmem) MB
EOF
+ cat
+ calc_mb 3203567616
+ expr 3203567616 / 1048576
+ echo 2047
+ return
+ calc_mb -465883137
+ expr -465883137 / 1048576
expr: illegal option -- 4
usage: expr [-e] expression
+ echo
+ return
+ calc_mb -1681600512
+ expr -1681600512 / 1048576
expr: illegal option -- 1
usage: expr [-e] expression
+ echo
+ return
Total real memory available:	2047 MB
Logically used memory:		 MB
Logically available memory:	 MB
My real mem (dmesg -a) is 3220897792 (3071 MB), btw
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #3  
Old April 8th, 2009, 18:13
danger@'s Avatar
danger@ danger@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Bratislava, Slovakia
Posts: 774
Thanks: 4
Thanked 167 Times in 84 Posts
Default

does http://people.freebsd.org/~rse/dist/freebsd-memory work for you well?
__________________
Looking for administrator? http://www.syscare.sk

Last edited by DutchDaemon; April 8th, 2009 at 20:17.
Reply With Quote
  #4  
Old April 8th, 2009, 19:58
icer icer is offline
Junior Member
 
Join Date: Nov 2008
Location: 10-RUS
Posts: 43
Thanks: 4
Thanked 6 Times in 6 Posts
Default

no errors and all true
Code:
CPU information

Machine class:	i386
CPU Model:	Intel(R) Pentium(R) Dual  CPU  E2200  @ 2.20GHz
Number of CPUs:	2

RAM information

System memory summary
Total real memory available:	1005 MB
Logically used memory:		481 MB
Logically available memory:	523 MB

Swap information
Device          1K-blocks     Used    Avail Capacity
/dev/ad6s1b       4194304       0B     4.0G     0%

Operating system information

Operating system release:	FreeBSD 7.1-RELEASE-p2
OS architecture:		i386
Hostname:			icer.local
Kernel build dir location:	/usr/obj/usr/src/sys/WiFi
Currently booted kernel:	/boot/kernel/kernel

Currently loaded kernel modules (kldstat):
acpi.ko
linprocfs.ko
linux.ko
Storage information

Available hard drives:
da3: <Generic USB MS Reader 1.03> Removable Direct Access SCSI-0 device 
da3: 1.000MB/s transfers
da3: Attempt to query device size failed: NOT READY, Medium not present
da2: <Generic USB SM Reader 1.02> Removable Direct Access SCSI-0 device 
da2: 1.000MB/s transfers
da2: Attempt to query device size failed: NOT READY, Medium not present
da1: <Generic USB CF Reader 1.01> Removable Direct Access SCSI-0 device 
da1: 1.000MB/s transfers
da1: Attempt to query device size failed: NOT READY, Medium not present
da0: <Generic USB SD Reader 1.00> Removable Direct Access SCSI-0 device 
da0: 1.000MB/s transfers
da0: Attempt to query device size failed: NOT READY, Medium not present
acd0: DVDR <Optiarc DVD RW AD-7170A/1.03> at ata2-master UDMA66
cd0: <Optiarc DVD RW AD-7170A 1.03> Removable CD-ROM SCSI-0 device 
cd0: 66.000MB/s transfers
cd0: Attempt to query device size failed: NOT READY, Medium not present
ad6: 76319MB <WDC WD800JD-60LSA5 10.01E03> at ata3-master SATA300

Currently mounted filesystems:
/dev/ad6s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ad6s1e on /tmp (ufs, local, soft-updates)
/dev/ad6s1f on /usr (ufs, local, soft-updates)
/dev/ad6s1d on /var (ufs, local, soft-updates)
procfs on /proc (procfs, local)
linprocfs on /usr/compat/linux/proc (linprocfs, local)

I/O statistics:
      tty             ad6              da0              da1             cpu
 tin tout  KB/t tps  MB/s   KB/t tps  MB/s   KB/t tps  MB/s  us ni sy in id
  14  209 11.09  11  0.12   0.01   0  0.00   0.01   0  0.00   6  0  2  2 90
INFO: 
Run gstat(8) to see live statistics.

Disk usage:
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad6s1a    496M    252M    204M    55%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ad6s1e    496M     17M    439M     4%    /tmp
/dev/ad6s1f     58G     27G     26G    52%    /usr
/dev/ad6s1d    9.7G    1.4G    7.5G    16%    /var
procfs         4.0K    4.0K      0B   100%    /proc
linprocfs      4.0K    4.0K      0B   100%    /usr/compat/linux/proc

Network information

hostname:  icer.local

Currently available network devices:
em0 ath0 fwe0 fwip0 lo0 pflog0 pfsync0

Basic configuration for currently available NICs:

em0:
MAC address: 00:1c:c0:73:7c:2c
IPv4 addresses:
192.168.x.x netmask 0xffffff00

ath0:
MAC address: 00:21:91:97:ba:5e
IPv4 addresses:
192.168.x.x netmask 0xffffff00
MAC address: 02:90:27:24:da:b9

lo0:
IPv4 addresses:
127.0.0.1 netmask 0xff000000
IPv6 addresses:
fe80::1%lo0 prefixlen 64
::1 prefixlen 128

Default route: 192.168.x.x
INFO: For a complete routing table please run netstat -rn

There are 12 currently opened or listening connections.
INFO: For more information please see sockstat(8) manual

Information related to services

Misc information

Currently logged-in users:
icer             v8       :0                9:51PM     - -
icer             p1       :0.0             10:48PM     - w -hi
icer             p0       :0.0              9:51PM     9 /usr/bin/as -o nsPlugi

Uptime:
10:50PM  up  4:55, 3 users, load averages: 1.17, 1.05, 0.88
thx, useful fiche
P.S. btw in my opinion, it will be useful if script check rc.conf and after what check runing services and show status. smf like this:
apache 2.2.1 - runing
samba 3.3.3 - runing

Last edited by DutchDaemon; April 8th, 2009 at 20:16. Reason: QINC! [quote] is not [code]
Reply With Quote
  #5  
Old April 8th, 2009, 20:17
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,935
Thanks: 30
Thanked 1,932 Times in 1,351 Posts
Default

Yes, that looks normal to me.

Code:
SYSTEM MEMORY INFORMATION:
mem_wire:         144449536 (    137MB) [  4%] Wired: disabled for paging out
mem_active:  +    179015680 (    170MB) [  5%] Active: recently referenced
mem_inactive:+    567050240 (    540MB) [ 18%] Inactive: recently not referenced
mem_cache:   +      2453504 (      2MB) [  0%] Cached: almost avail. for allocation
mem_free:    +   2252898304 (   2148MB) [ 71%] Free: fully available for allocation
mem_gap_vm:  +       688128 (      0MB) [  0%] Memory gap: UNKNOWN
-------------- ------------ ----------- ------
mem_all:     =   3146555392 (   3000MB) [100%] Total real memory managed
mem_gap_sys: +     57012224 (     54MB)        Memory gap: Kernel?!
-------------- ------------ -----------
mem_phys:    =   3203567616 (   3055MB)        Total real memory available
mem_gap_hw:  +     17657856 (     16MB)        Memory gap: Segment Mappings?!
-------------- ------------ -----------
mem_hw:      =   3221225472 (   3072MB)        Total real memory installed

SYSTEM MEMORY SUMMARY:
mem_used:         398823424 (    380MB) [ 12%] Logically used memory
mem_avail:   +   2822402048 (   2691MB) [ 87%] Logically available memory
-------------- ------------ ----------- ------
mem_total:   =   3221225472 (   3072MB) [100%] Logically total memory
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #6  
Old April 9th, 2009, 01:59
zordio zordio is offline
Junior Member
 
Join Date: Apr 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I also get an error in the memory section:

Code:
expr: illegal option -- 1
usage: expr [-e] expression
expr: syntax error
I threw a few extra lines into 020.mem to see the values of the memory variables:

Code:
physmem: 3744890880
activemem: 140959744
inactmem: -1125810176
cachemem: 142274560
allmem: -616513536
wiremem: 211468288
freemem: 13770752
and the direct sysctl outputs (done after the script ran, so the results might be a little different) are:

Code:
hw.pagesize: 4096
hw.physmem: 3744890880
vm.stats.vm.v_active_count: 34425
vm.stats.vm.v_inactive_count: 773958
vm.stats.vm.v_cache_count: 34531
vm.stats.vm.v_page_count: 898060
vm.stats.vm.v_wire_count: 51683
vm.stats.vm.v_free_count: 3258
Seems to be an overflow error for memory above a certain size.
Reply With Quote
  #7  
Old April 9th, 2009, 08:27
danger@'s Avatar
danger@ danger@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Bratislava, Slovakia
Posts: 774
Thanks: 4
Thanked 167 Times in 84 Posts
Default

interesting...I will check later today and see what's going on. I have been developing this tool on 8gb box, so it's a bit weird. We will see.
__________________
Looking for administrator? http://www.syscare.sk
Reply With Quote
  #8  
Old April 9th, 2009, 08:29
danger@'s Avatar
danger@ danger@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Bratislava, Slovakia
Posts: 774
Thanks: 4
Thanked 167 Times in 84 Posts
Default

Yup, the services part is not yet implemented. I will be working on this part today or maybe during the weekend and Easter holidays.

Having that said, I would like to hear what kind of information you guys are interested to see in the script's output in that regard.

Thanks.
__________________
Looking for administrator? http://www.syscare.sk
Reply With Quote
  #9  
Old April 9th, 2009, 10:16
danger@'s Avatar
danger@ danger@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Bratislava, Slovakia
Posts: 774
Thanks: 4
Thanked 167 Times in 84 Posts
Default

what does % expr 3744890880 / 1048576 give you?
__________________
Looking for administrator? http://www.syscare.sk
Reply With Quote
  #10  
Old April 9th, 2009, 17:23
zordio zordio is offline
Junior Member
 
Join Date: Apr 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by danger@ View Post
what does % expr 3744890880 / 1048576 give you?
That gives 2047. Although the problem seemed to be with multiplication, not division.

While reading the expr man page, I noticed the -e option, to detect overflows. I added it to the script, and no longer get errors:

Code:
RAM information

System memory summary
Total real memory available:    3571 MB
Logically used memory:          398 MB
Logically available memory:     3172 MB

Swap information
Device          1K-blocks     Used    Avail Capacity
/dev/twed0s1b     4194304     248K     4.0G     0%
Reply With Quote
  #11  
Old April 9th, 2009, 17:41
danger@'s Avatar
danger@ danger@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Bratislava, Slovakia
Posts: 774
Thanks: 4
Thanked 167 Times in 84 Posts
Default

I thought that will be a problem

can you please test http://people.freebsd.org/~danger/sy...9-alpha.tar.gz for me?
__________________
Looking for administrator? http://www.syscare.sk
Reply With Quote
  #12  
Old April 9th, 2009, 19:01
lme@'s Avatar
lme@ lme@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Düsseldorf, Germany
Posts: 590
Thanks: 44
Thanked 182 Times in 90 Posts
Default

Daniel, that's a very nice script!
Code:
Available hard drives:
acd0: DVDR <TSSTcorpCD/DVDW TS-L632D/SC01> at ata0-slave UDMA33
acd0: FAILURE - INQUIRY ILLEGAL REQUEST asc=0x24 ascq=0x00
cd0: <TSSTcorp CD/DVDW TS-L632D SC01> Removable CD-ROM SCSI-0 device
cd0: 33.000MB/s transfers
cd0: Attempt to query device size failed: NOT READY, 
^^^^ should be grepped out
Medium not present - tray closed
acpi_acad0: <AC Adapter> on acpi0
^^^^^^^^^^^^^^^^^^^^^^^
  no, this is not a drive ;-)
ad0: 114473MB <Seagate ST9120822A 3.ALC> at ata0-master UDMA100
Code:
Basic configuration for currently available NICs:
MAC address: 00:13:02:3f:0d:e4
MAC address: 00:00:f0:7f:da:00
MAC address: 02:00:f0:0f:ab:79
You should add the device names here.

Code:
Default route: 192.168.10.1
Here you could add the interface.
Reply With Quote
  #13  
Old April 9th, 2009, 21:17
zordio zordio is offline
Junior Member
 
Join Date: Apr 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by danger@ View Post
I thought that will be a problem

can you please test http://people.freebsd.org/~danger/sy...9-alpha.tar.gz for me?
No errors, info looks correct.
Reply With Quote
  #14  
Old April 9th, 2009, 21:47
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,935
Thanks: 30
Thanked 1,932 Times in 1,351 Posts
Default

No errors here.
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #15  
Old April 9th, 2009, 23:21
gelraen gelraen is offline
Junior Member
 
Join Date: Nov 2008
Location: Ukraine, Kyiv
Posts: 32
Thanks: 3
Thanked 4 Times in 2 Posts
Default

Code:
CPU information

Machine class:  i386
CPU Model:      Intel(R) Core(TM)2 Duo CPU     T7250  @ 2.00GHz
Number of CPUs: 2

RAM information

System memory summary
Total real memory available:    2035 MB
Logically used memory:          1352 MB
Logically available memory:     682 MB

Swap information
Device          512-blocks     Used    Avail Capacity
/dev/ad4s1b        4194304     920K     2.0G     0%

Operating system information

Operating system release:       FreeBSD 8.0-CURRENT
OS architecture:                i386
Hostname:                       imax
Kernel build dir location:      /usr/obj/usr/src/sys/HEAD
Currently booted kernel:        /boot/kernel/kernel

Currently loaded kernel modules (kldstat):
drm.ko
radeon.ko
linprocfs.ko
linux.ko
ng_socket.ko
ng_mppc.ko
rc4.ko
ng_iface.ko
ng_ppp.ko
fuse.ko
kqemu.ko
Storage information

Available hard drives:
acd0: DVDR <MATSHITADVD-RAM UJ-861H/1.50> at ata0-master PIO4
acd0: FAILURE - INQUIRY ILLEGAL REQUEST asc=0x24 ascq=0x00
acd0: FAILURE - INQUIRY ILLEGAL REQUEST asc=0x24 ascq=0x00
cd0: <MATSHITA DVD-RAM UJ-861H 1.50> Removable CD-ROM SCSI-0 device
cd0: 16.000MB/s transfers
cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed
ad4: 152627MB <FUJITSU MHY2160BH 890B> at ata2-master SATA150

Currently mounted filesystems:
/dev/ufs/root on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ufs/tmp on /tmp (ufs, local, soft-updates)
/dev/ufs/usr on /usr (ufs, local, soft-updates)
/dev/ufs/var on /var (ufs, local, soft-updates)
procfs on /proc (procfs, local)
linprocfs on /usr/compat/linux/proc (linprocfs, local)
devfs on /usr/compat/linux/dev (devfs, local)
/usr/home/imax/music/Audio on /var/ftp/music/audio (nullfs, local, read-only)
/usr/home/imax/music/Video on /var/ftp/music/video (nullfs, local, read-only)
/usr/home/imax/music/Lyrics on /var/ftp/music/lyrics (nullfs, local, read-only)
/usr/home/imax/Films on /var/ftp/films (nullfs, local, read-only, union)
/usr/home/imax/Share on /var/ftp/share (nullfs, local, read-only)
/var/ftp/incoming on /usr/home/imax/incoming (nullfs, local)
/usr/ports/distfiles on /var/ftp/distfiles (nullfs, local, read-only)
/usr/home/imax/Documents/docs on /var/ftp/docs (nullfs, local, read-only)
devfs on /var/named/dev (devfs, local)

I/O statistics:
      tty             ad4              cd0            pass0             cpu
 tin tout  KB/t tps  MB/s   KB/t tps  MB/s   KB/t tps  MB/s  us ni sy in id
  57 1588 65.26  17  1.05   0.00   0  0.00   0.00   0  0.00  17  3  9  1 69
modules/030.storage: DEBUG: checkyesno: INFO_MSGS is set to YES.
INFO: Run gstat(8) to see live statistics.

Disk usage:
Filesystem                       Size    Used   Avail Capacity  Mounted on
/dev/ufs/root                    496M    167M    289M    37%    /
devfs                            1.0K    1.0K      0B   100%    /dev
/dev/ufs/tmp                     989M    123M    787M    13%    /tmp
/dev/ufs/usr                     138G    135G    1.2G    99%    /usr
/dev/ufs/var                     2.9G    687M    2.0G    25%    /var
procfs                           4.0K    4.0K      0B   100%    /proc
linprocfs                        4.0K    4.0K      0B   100%    /usr/compat/linux/proc
devfs                            1.0K    1.0K      0B   100%    /usr/compat/linux/dev
/usr/home/imax/music/Audio       138G    135G    1.2G    99%    /var/ftp/music/audio
/usr/home/imax/music/Video       138G    135G    1.2G    99%    /var/ftp/music/video
/usr/home/imax/music/Lyrics      138G    135G    1.2G    99%    /var/ftp/music/lyrics
/usr/home/imax/Films             138G    135G    1.2G    99%    /var/ftp/films
/usr/home/imax/Share             138G    135G    1.2G    99%    /var/ftp/share
/var/ftp/incoming                2.9G    687M    2.0G    25%    /usr/home/imax/incoming
/usr/ports/distfiles             138G    135G    1.2G    99%    /var/ftp/distfiles
/usr/home/imax/Documents/docs    138G    135G    1.2G    99%    /var/ftp/docs
devfs                            1.0K    1.0K      0B   100%    /var/named/dev

Network information

hostname:  imax

Currently available network devices:
em0 wpi0 lo0 vlan0 ng0 gif0 gif1 gif4

Basic configuration for currently available NICs:

em0:
MAC address: 00:1a:4b:76:91:e1
IPv4 addresses:
10.45.71.120 netmask 0xffffff80
MAC address: 00:1c:bf:2e:dc:fc

lo0:
IPv4 addresses:
127.0.0.1 netmask 0xff000000
IPv6 addresses:
fe80::1%lo0 prefixlen 64
::1 prefixlen 128

vlan0:
MAC address: 00:1a:4b:76:91:e1
IPv4 addresses:
10.45.74.7 netmask 0xffffff00

gif0:
IPv4 addresses:
inet 10.45.74.7 -->
192.168.100.1 --> 192.168.100.2

gif1:
IPv4 addresses:
inet 10.45.74.7 -->
192.168.100.1 --> 192.168.100.3

gif4:
IPv4 addresses:
inet 10.45.74.7 -->
192.168.100.17 --> 192.168.100.18

Default route: 10.45.74.254
modules/040.network: DEBUG: checkyesno: INFO_MSGS is set to YES.
INFO: For a complete routing table please run netstat -rn

There are 183 currently opened or listening connections.
modules/040.network: DEBUG: checkyesno: INFO_MSGS is set to YES.
INFO: For more information please see sockstat(8) manual

Information related to services

Misc information

Currently logged-in users:
root             pts/10   :pts/9:S.0       Thu03PM  9:18 /usr/local/bin/zsh

Uptime:
12:55AM  up 10:51, 1 user, load averages: 0.55, 0.56, 0.59
ifconfig output parsing not adopted for point-to-point interfaces.

Maybe resolv.conf should be printed in network information.
Also, information about firewall could be useful (as for ipfw - at least sysctl net.inet(6).ip(6).fw.enable, net.link.ether.ipfw and net.link.bridge.ipfw variables).

P.S.: `./sysinfo -a | less` full of esacpe sequences used for coloring which makes output some less readable.

P.P.S.: thanks for developing such tool
Reply With Quote
  #16  
Old April 9th, 2009, 23:48
danger@'s Avatar
danger@ danger@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Bratislava, Slovakia
Posts: 774
Thanks: 4
Thanked 167 Times in 84 Posts
Default

Quote:
Originally Posted by gelraen View Post
ifconfig output parsing not adopted for point-to-point interfaces.
First, let me thank you for the feedback.

Could you please send me the output of your ifconfig, so I can fix it for P2P devices?

Quote:
Originally Posted by gelraen View Post
Maybe resolv.conf should be printed in network information.
Feature added in my local version, thanks for an idea.

Quote:
Originally Posted by gelraen View Post
Also, information about firewall could be useful (as for ipfw - at least sysctl net.inet(6).ip(6).fw.enable, net.link.ether.ipfw and net.link.bridge.ipfw variables).
That's a great idea, I will implement it soon.

Quote:
Originally Posted by gelraen View Post
P.S.: `./sysinfo -a | less` full of esacpe sequences used for coloring which makes output some less readable.
That's why there's -c option

Quote:
Originally Posted by gelraen View Post
P.P.S.: thanks for developing such tool
It's nice to hear such words, thanks
Actually it's being developed as part of my bachelor thesis.
__________________
Looking for administrator? http://www.syscare.sk

Last edited by danger@; April 9th, 2009 at 23:55.
Reply With Quote
  #17  
Old April 9th, 2009, 23:55
danger@'s Avatar
danger@ danger@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Bratislava, Slovakia
Posts: 774
Thanks: 4
Thanked 167 Times in 84 Posts
Default

Quote:
Originally Posted by lme@ View Post
[code]
cd0: Attempt to query device size failed: NOT READY,
^^^^ should be grepped out
Medium not present - tray closed
acpi_acad0: <AC Adapter> on acpi0
^^^^^^^^^^^^^^^^^^^^^^^
no, this is not a drive ;-)
I think I have fixed this in my local version I will release new version probably during the weekend so you will be welcome to test it

Quote:
Originally Posted by lme@ View Post
Code:
Basic configuration for currently available NICs:
MAC address: 00:13:02:3f:0d:e4
MAC address: 00:00:f0:7f:da:00
MAC address: 02:00:f0:0f:ab:79
You should add the device names here.
I wonder how does your ifconfig output look like?

Quote:
Originally Posted by lme@ View Post
Code:
Default route: 192.168.10.1
Here you could add the interface.
Added.
__________________
Looking for administrator? http://www.syscare.sk
Reply With Quote
  #18  
Old April 10th, 2009, 13:19
gelraen gelraen is offline
Junior Member
 
Join Date: Nov 2008
Location: Ukraine, Kyiv
Posts: 32
Thanks: 3
Thanked 4 Times in 2 Posts
Default

Quote:
Originally Posted by danger@ View Post
Could you please send me the output of your ifconfig, so I can fix it for P2P devices?
Code:
% ifconfig gif0
gif0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1280
        tunnel inet 10.45.74.7 --> 10.45.67.94
        inet 192.168.100.17 --> 192.168.100.18 netmask 0xffffffff
General interface looks like this:
Code:
% ifconfig vlan0
vlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3<RXCSUM,TXCSUM>
        ether 00:1a:4b:76:91:e1
        inet 10.45.74.7 netmask 0xffffff00 broadcast 10.45.74.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        vlan: 1000 parent interface: em0
Quote:
Originally Posted by danger@ View Post
That's why there's -c option
Oh, sorry, I've missed this one

And one more small thing, when started without parameters it show help message followed by
Code:
./sysinfo: ERROR: Not enough arguments provided.
Reply With Quote
  #19  
Old April 11th, 2009, 15:19
marius marius is offline
Junior Member
 
Join Date: Nov 2008
Location: Norway
Posts: 68
Thanks: 6
Thanked 16 Times in 9 Posts
Default

The script seems to work correctly on my Soekris.
Reply With Quote
  #20  
Old April 11th, 2009, 17:00
danger@'s Avatar
danger@ danger@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Bratislava, Slovakia
Posts: 774
Thanks: 4
Thanked 167 Times in 84 Posts
Thumbs up SysInfo v0.4 release

Hello guys,

I have packaged a new version of my script. It can be downloaded from http://people.freebsd.org/~danger/sy...-110409.tar.gz.

Please test it (including execution with -v to include verbose information) and report any bugs you may have found.

I am still also interested in ideas on what should this script document.

Thanks in advance!
__________________
Looking for administrator? http://www.syscare.sk
Reply With Quote
  #21  
Old April 11th, 2009, 17:34
mwatkins mwatkins is offline
Member
 
Join Date: Apr 2009
Location: Vancouver
Posts: 121
Thanks: 3
Thanked 14 Times in 13 Posts
Default

Your latest script works without issue on my slightly out-dated version of FreeBSD 7.1 and served to remind me I have to do an OS update this weekend.

Quick small issue - advice in the following statement is spelled incorrectly:

INFO: For system tuning adice, see the tuning(7) man page.
Reply With Quote
  #22  
Old April 11th, 2009, 19:08
gelraen gelraen is offline
Junior Member
 
Join Date: Nov 2008
Location: Ukraine, Kyiv
Posts: 32
Thanks: 3
Thanked 4 Times in 2 Posts
Default

1) check_firewalls() should handle also $firewall_type, not just $firewall_script (btw, maybe will be better to say "ipfw show" instead)

2) services module output full of
Code:
Cannot 'status' snmpd. Set snmpd_enable to YES in /etc/rc.conf or use 'onestatus' instead of 'status'.
3) Socket statistics doesn't count tcp/udp sockets. And phrase "IP connections" has no sense.
Reply With Quote
  #23  
Old April 12th, 2009, 08:02
trev trev is offline
Member
 
Join Date: Dec 2008
Posts: 343
Thanks: 13
Thanked 39 Times in 36 Posts
Default

Quote:
CPU information
You could add vmstat(8) -i info after cpu info.

Quote:
System memory summary
You could vmstat(8) output here.

Quote:
Currently mounted filesystems:
You could compare against /etc/fstab and list currently unmounted filesystems too.

Quote:
Disk usage:
After this, it might be useful to see the output of dump(8) -W ... although I'm sure everyone's backups would be up-to-date

Quote:
MAC address: 00:1f:d0:a4cc
IPv4 addresses:
192.168.1.4 netmask 0xffffff00
Why does the MAC address run on? Most of your other info after a colon starts a new line.

Quote:
Firewall related information:
Leave this out if there isn't any firewall info? Or say "no firewall info found" ?

Quote:
INFO: Use the portsnap(8) tool to update your ports tree.
Why not csup(1) with compression? Faster and smaller updates.

Quote:
Services status

adzapper is running as pid 730.

apache is running as pid 736.

apcupsd is running as pid 625.

bsdstats is not running.

...
Why the blank line between entries?

Quote:
INFO: Configuration of system-wide services is located in the /etc/ directory.
INFO: Configuration files for local services can be found in the /usr/local/etc/
Might as well be consistent and make it "Configuration of..." rather than "Configuration files for..." the second time.

Nice job!
Reply With Quote
  #24  
Old April 14th, 2009, 12:26
danger@'s Avatar
danger@ danger@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Bratislava, Slovakia
Posts: 774
Thanks: 4
Thanked 167 Times in 84 Posts
Default

Hello,

it's me again! I have put up a new version of SysInfo (0.5), which can be downloaded from http://people.freebsd.org/~danger/sy...-140409.tar.gz.

In this version, I have incomporated the latest feedback I have recieved. I would be very thankful if anybody could test it in their own environment and report any bugs found in this release.

As a last note -- I am still looking for ideas of what should be documented by this script.
__________________
Looking for administrator? http://www.syscare.sk
Reply With Quote
  #25  
Old April 14th, 2009, 12:52
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,935
Thanks: 30
Thanked 1,932 Times in 1,351 Posts
Default

Two quirks:

Double:

Code:
Available hard drives:
cd0: <HL-DT-ST DVDRAM GSA-T40L KC07> Removable CD-ROM SCSI-0 device 
cd0: 16.000MB/s transfers
cd0: <HL-DT-ST DVDRAM GSA-T40L KC07> Removable CD-ROM SCSI-0 device 
cd0: 16.000MB/s transfers
ad8: 114473MB <Seagate ST9120823AS 3.AHE> at ata4-master SATA300
ad8: 114473MB <Seagate ST9120823AS 3.AHE> at ata4-master SATA300
?

Code:
Firewall related information:
[: -ne: unexpected operator
(not using any)
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
Reply

Tags
sysinfo, system configuration, system documentation

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Useful scripts Dr_Phoenix Userland Programming & Scripting 216 May 7th, 2013 12:40
[Solved] [OpenVPN] How to set up a client? fonz Web & Network Services 9 February 18th, 2009 16:08
a couple of scripts for screen users rbelk Userland Programming & Scripting 13 February 11th, 2009 23:20
how to set time? hirohitosan General 13 January 22nd, 2009 11:42
Blender & external scripts directory Ole Installation and Maintenance of FreeBSD Ports or Packages 1 December 25th, 2008 22:24


All times are GMT +1. The time now is 00:07.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0