SysInfo: a set of scripts that document your system

OP
OP
danger@

danger@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 342
Messages: 980

#26
I wonder whether your /var/run/dmesg.boot contains content from previous boot (i.e. not only the last one)?

As of the bug in FW section: I believe I have fixed this in my new local version (haven't tested on the system w/o fw), Thanks.
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 2,656
Messages: 11,226

#27
I have no idea ;) Just a clean and planned reboot, and it shows up thusly in /var/run/dmesg.boot :

Code:
Waiting (max 60 seconds) for system process `vnlru' to stop...done
Waiting (max 60 seconds) for system process `bufdaemon' to stop...done
Waiting (max 60 seconds) for system process `syncer' to stop...
Syncing disks, vnodes remaining...3 2 2 0 0 done
All buffers synced.
Uptime: 1h37m8s
Rebooting...
cpu_reset: Stopping other CPUs
Copyright (c) 1992-2009 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 7.2-PRERELEASE #0: Thu Mar 19 15:26:46 CET 2009
Maybe default behaviour for a warm boot?
 

fraenki

Member

Thanks: 4
Messages: 29

#28
Nice script, thank you. Some suggestions:
  • display whether CPU supports 64-bit or not (x86-64)
  • more information about hardware (in addition to "graphic card information")
    -> storage controller vendor/device information
    -> network controller vendor/device information
  • system boot date and time (in addition to "system uptime")
  • Top 10 most frequently logged-in users (this month)
 

royce

New Member


Messages: 10

#30
Great idea!

ipfilter isn't being detected because of a minor test bug in 140409. Running 040.network using 'sh -x', the error is:

Code:
+ [ ! -z ]
+ sysctl -n net.inet.ipf.fr_running
+ stat=1
+ [ ! -z 1]
[: missing ]
+ [ 0 -ne 1 ]
+ warn No firewall is being used on this system.
+ echo -e WARNING: No firewall is being used on this system.
WARNING: No firewall is being used on this system.
Just a typo:

Code:
--- 040.network 2009-04-14 04:10:33.000000000 -0800
+++ 040.network.new     2009-04-14 13:38:44.000000000 -0800
@@ -53,7 +53,7 @@

        # IPF
        stat=`sysctl -n net.inet.ipf.fr_running 2>/dev/null`
-       if [ ! -z $stat]  && [ $stat -eq 1 ]; then
+       if [ ! -z $stat ]  && [ $stat -eq 1 ]; then
                fw=1

                echo "ipfilter is enabled."
Keep up the good work!
 

f-andrey

Member

Thanks: 8
Messages: 42

#32
Nice script
sysinfo-150409.tar.gz
Code:
# ./sysinfo -a -v 1 > info.txt 
WARNING: No firewall is being used on this system.
ps: illegal argument: to
usage: ps [-aCcefHhjlmrSTuvwXxZ] [-O fmt | -o fmt] [-G gid[,gid...]]
          [-M core] [-N system]
          [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]
       ps [-L]
ps: illegal argument: to
usage: ps [-aCcefHhjlmrSTuvwXxZ] [-O fmt | -o fmt] [-G gid[,gid...]]
          [-M core] [-N system]
          [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]
       ps [-L]
Code:
# ./sysinfo -a > info0.txt
work

Some suggestion:
Parsing program arguments

Code:
# ./sysinfo -ac
not work
my_book# ./sysinfo -a -c
work
 

Attachments

OP
OP
danger@

danger@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 342
Messages: 980

#33
I wonder why some of you guys get these:

Code:
Cannot 'status' ipxrouted. Set ipxrouted_enable to YES in /etc/rc.conf or use 'onestatus' instead of 'status'
does anyone have an idea? I don't get it on my machines....interesting. That's the reason you got those ps errors.

As of the argument parsing, this is a common issue with shell scripts (or maybe I am missing something), you have to live with that, sorry :(
 
OP
OP
danger@

danger@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 342
Messages: 980

#34
fraenki, devel:
I have added your requests to the latest version.
 

f-andrey

Member

Thanks: 8
Messages: 42

#35
danger@ said:
I wonder why some of you guys get these:

Code:
Cannot 'status' ipxrouted. Set ipxrouted_enable to YES in /etc/rc.conf or use 'onestatus' instead of 'status'
does anyone have an idea? I don't get it on my machines....interesting. That's the reason you got those ps errors.
I got those ps errors.
Code:
# sh -x ./sysinfo -a -v 1
...
Cannot 'status' kpasswdd. Set kpasswdd_server_enable to YES in /etc/rc.conf or use 'onestatus' instead of 'status'.
ps: illegal argument: to
...
Cannot 'status' yppasswdd. Set nis_yppasswdd_enable to YES in /etc/rc.conf or use 'onestatus' instead of 'status'.
ps: illegal argument: to
...
 
OP
OP
danger@

danger@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 342
Messages: 980

#36
These messages are probably 8.0 feature (I don't run 8.0 personally, so I can't test), because I have tested several 7.x machines and they do not experience this bug.
 

Graaf_van_Vlaanderen

Active Member

Thanks: 8
Messages: 199

#37
Here is my info from 'sysinfo -a'
There is actually only "one" hyper-threaded CPU.

Code:
[root@Hjordis /home/depaepe/Technical/sysinfo]# sh sysinfo -a
CPU information

Machine class:	amd64
CPU Model:	Intel(R) Xeon(TM) CPU 3.40GHz
Number of CPUs:	2

RAM information

System memory summary
Total real memory available:	2035 MB
Logically used memory:		309 MB
Logically available memory:	1725 MB

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

Operating system information

Operating system release:	FreeBSD 7.1-RELEASE-p4
OS architecture:		amd64
Hostname:			Hjordis
Kernel build dir location:	/usr/obj/usr/src/sys/GENERIC
Currently booted kernel:	/boot/kernel/kernel

No additional kernel modules are currently loaded.

INFO: For security recommendations see the security(7) man page.
INFO: For system tuning advice, see the tuning(7) man page.
INFO: To view various system statistics use the systat(1) tool.

Storage information

Available hard drives:
da1: <COMPAQ RAID 0  VOLUME OK> Fixed Direct Access SCSI-0 device 
da1: 135.168MB/s transfers
da1: 69459MB (142253280 512 byte sectors: 255H 32S/T 17433C)
da0: <COMPAQ RAID 0  VOLUME OK> Fixed Direct Access SCSI-0 device 
da0: 135.168MB/s transfers
da0: 69459MB (142253280 512 byte sectors: 255H 32S/T 17433C)

Raid controllers:
ciss0:
vendor='Compaq Computer Corp (Now owned by Hewlett-Packard)'
device='Smart Array 64xx Controller'

Currently mounted filesystems:
/dev/da0s1a on /
devfs on /dev
/dev/da0s1e on /tmp
/dev/da0s1f on /usr
/dev/da0s1d on /var


I/O statistics:
      tty             da0              da1            pass0             cpu
 tin tout  KB/t tps  MB/s   KB/t tps  MB/s   KB/t tps  MB/s  us ni sy in id
   0   91 20.17   2  0.03   1.94   0  0.00   0.00   0  0.00  79  0  0  0 20
INFO: Run iostat(8) or gstat(8) to see live statistics.

Disk usage:
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/da0s1a    496M    354M    102M    78%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/da0s1e    496M    3.7M    452M     1%    /tmp
/dev/da0s1f     58G     13G     40G    24%    /usr
/dev/da0s1d    2.9G    534M    2.1G    20%    /var

Network information

hostname: Hjordis

Currently available network devices:
bge0 bge1 lo0

Basic configuration for currently available NICs:

bge0:
MAC address:
00:12:79:94:19:60
IPv4 addresses:
192.168.1.4 netmask 0xffffff00

bge1:
MAC address:
00:12:79:94:19:5f

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

Default route:
192.168.1.1 via bge0
INFO: For a complete routing table please run netstat -rn.

Firewall related information:
WARNING: No firewall is being used on this system.
INFO: There are several firewall packages on FreeBSD.
INFO: You may want to check http://www.freebsd.org/doc/en/books/handbook/firewalls.html.

Resolver name servers:
192.168.1.1

Socket statistics:
There are currently 13 listening (11 TCP/2 UDP) and 15 connected connections.
INFO: For more information please see sockstat(8) manual.

Packages information

There are 527 packages installed in the system and 0 of them needs updating.
Note that this number may be inaccurate, as your ports tree may be outdated too.

INFO: Run pkg_info(1) to see a full list of installed packages.
INFO: Use pkg_version(1) to inspect what packages are outdated.
INFO: Use the portsnap(8) or csup(1) tool to update your ports tree.

Information related to services

Services status
cupsd is not running.
dbus is not running.
ffserver is not running.
hald is not running.
xfs is not running.
cron is running as pid 732.
devd is running as pid 524.
newsyslog is not running.
sendmail_submit is running as pid 722.
sendmail_clientmqueue is running as pid 726.
sshd is running as pid 716.
syslogd is running as pid 591.
wpa_supplicant is not running.

INFO: Configuration of system-wide services is located in the /etc/ directory.
INFO: Configuration of 3rd party services can be found in the /usr/local/etc/ directory.

Misc information

Graphic card information:
vendor='ATI Technologies Inc'
device='Rage XL PCI'
INFO: Check pciconf(8) for more information.

Currently logged-in users:
depaepe          p3       192.168.1.2      12:44PM     - w -hi
depaepe          p1       192.168.1.2      12:43PM     - bash
depaepe          p2       192.168.1.2      12:44PM    40 /usr/local/libexec/octave/3.0.5/exec/amd64-portbld-freebsd7.1/octave-3.0.5
depaepe          p0       192.168.1.2      12:43PM  2:38 top -uP

Top 10 logged-in users this month:
ac: /var/log/wtmp.0: No such file or directory

System uptime:
System is booted since Thu Apr 16 12:41:13 2009
 3:23PM  up  2:42, 4 users, load averages: 0.08, 0.42, 1.06
 

irado

New Member


Messages: 5

#38
how to conf?

sorry, but I have no expertise to just read a bunch of scripts and know what to do :( :r

so, besides a novice (in that matter) I think that I desperately need your script <G> but:

HOW can I configure the rc.conf? the sysinfo script is asking to put variables there but.. which ones is it asking for?

thank you
 

bsdsx

New Member


Messages: 1

#39
First, thanks for you great work.
Second, sorry for my english.
Third, i have many comments in my /etc/resolv.conf but sysinfo
parse each lines.

modules/040.network

Code:
subsect "\nResolver name servers:"
awk '/^#/ { next } /nameserver/ { print $2 }' /etc/resolv.conf
Skip the comment line (without "grep" :) and print ip
 
OP
OP
danger@

danger@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 342
Messages: 980

#40
Thanks, I didn't think about comments in /etc/resolv.conf in my code.
I have inspired myself by your advise, however have used a bit different code in my local new version

Code:
awk '/^nameserver/ {print $2}' /etc/resolv.conf
Hope that will work for you.
 

gnemmi

Active Member

Thanks: 21
Messages: 218

#41
Marvelous work!
Works really well in here and it shows a lot more info than what I was expecting !

One thing though .. just a suggestion .. could you please consider doing something like:

Code:
Services status

Running
..
..
..

Not running
...
...
...
I'll be using your script _a_lot_ !!!

Thanks once again and please keep up the good work you are doing :D

PS: sysinfo-150409.tar.gz
 

irado

New Member


Messages: 5

#43
irado said:
sorry, but I have no expertise to just read a bunch of scripts and know what to do :( :r

so, besides a novice (in that matter) I think that I desperately need your script <G> but:

HOW can I configure the rc.conf? the sysinfo script is asking to put variables there but.. which ones is it asking for?

thank you
sure enough this is a so stupid question that not even desserves a "bad comment", it is more contundent just being ignored.

thanks, anyway.
 

Mel_Flynn

Well-Known Member

Thanks: 80
Messages: 379

#44
danger@ said:
Hello guys,

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.
If by this you mean, like inheriting a system from a previous admin that left no docs around, then this is what I find out:
  • /boot/loader.conf
  • diff /boot/device.hints /usr/src/sys/$arch/conf/GENERIC.hints
  • Which settings from /etc/defaults/rc.conf have been changed, mostly local_startup and ldconfig_paths are of interest
  • Users in wheel with valid shell
  • sockstat -l
  • files in /etc/rc.d that should not be there (comparison with /usr/src/etc/rc.d)
  • Modification time of /var/db/mergemaster.mtree
  • portaudit -a
  • df -h, jls, mount -p, kldstat
  • pci devices without driver
  • geom modules status (gmirror, geli etc)
  • Whether NSS is enabled and what backends
  • Whether sshd allows root login, allows password based login and subsystems running
  • Number of physical CPU's, cores and logical ones.

That's pretty much my main list, hope this helps.

danger@ said:
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/sysinfo/sysinfo-140409.tar.gz.
Missing which of available network interfaces are UP.
Should really call onestatus for rc.d services

Other then that, good work! :stud
 

MG

Active Member

Thanks: 17
Messages: 191

#45
sysinfo misc:

Top 10 logged-in users this month:
ac: /var/log/wtmp.0: No such file or directory

I have only binary file wtmp in /var/log
 

plamaiziere

Active Member

Thanks: 40
Messages: 184

#46
Thanks for this script.

(tests with version 0.8)

The test to see if the CPU supports amd64 returns a wrong result with AMD Geode CPU (because the script looks for "AMD Features"):

Code:
CPU: Geode(TM) Integrated Processor by AMD PCS (499.91-MHz 586-class CPU)      
  Origin = "AuthenticAMD"  Id = 0x5a2  Stepping = 2                            
  Features=0x88a93d<FPU,DE,PSE,TSC,MSR,CX8,SEP,PGE,CMOV,CLFLUSH,MMX>           
  AMD Features=0xc0400000<MMX+,3DNow!+,3DNow!>
No a bug but on this box (a Soekris Net5501) dmidecode does not return anything:
Code:
# dmidecode -t bios
# dmidecode 2.9
# No SMBIOS nor DMI entry point found, sorry.
 

hbokh

New Member


Messages: 11

#47
amd64 on a 10yr old PC?

Nice script indeed!
One small issue: I run FreeBSD 6.4-RELEASE-p1 on an old Pentium2 400MHz so I think to run amd64 on this would be impossible... ;)

Code:
# ./sysinfo cpu
CPU information

Machine class:	i386
CPU Model:	Pentium II/Pentium II Xeon/Celeron
No. of Cores:	1

WARNING: Your CPU supports amd64 architecture, however you are running i386.
WARNING: You may want to switch to amd64 to get a better performance.
 
OP
OP
danger@

danger@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 342
Messages: 980

#48
Ah, it should check against /var/log/wtmp for the current month...thanks.
 
Top