• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

SysInfo: a set of scripts that document your system

edhunter

Member

Thanks: 10
Messages: 72

#76
Hello,
really nice tool

I havent tested it very hard,
I just noticed one error on running
Code:
sysinfo -c -a | more
here it is:
Code:
...
...
Hostname:                       test.xxxxxx
Kernel build dir location:      /usr/obj/usr/src/sys/TESTPC
Currently booted kernel:        /boot/kernel/kernel

Currently loaded kernel modules (kldstat(8)):
linux.ko
--More--(byte 1514)[color="Red"]sysctl: unknown oid 'net.inet6.ip6.forwarding'
[: -eq: unexpected operator[/color]
May be that is because I use custom kernel with commented inet6.

Latest version from ports:
Code:
sysinfo-0.8.6       Utility used to gather system configuration information
machine:
Code:
FreeBSD test.xxxxxxx 7.1-STABLE FreeBSD 7.1-STABLE #0: Wed Feb 11 15:11:25 EET 2009     root@xxxxxx:/usr/obj/usr/src/sys/TESTPC  i386
 

kamikaze

Well-Known Member

Thanks: 71
Messages: 366

#77
Test is allergic to empty strings in numeriacal comparisons. I normally use something like this:
Code:
value="$(sysctl -n net.inet6.ip6.forwarding 2> /dev/null)"
if [ ${value:-0} -eq ...
 

trev

Aspiring Daemon

Thanks: 100
Messages: 587

#80
Version from /ports/sysutils (perhaps the first line of the output should include the version number?)

Code:
RAM information

Memory information from dmidecode(8)
Maximum Memory Module Size: 1024 MB
Maximum Total Memory Size: 4096 MB
Maximum Capacity: 2 GB
Number Of Devices: 4
Why 4096 MB but then 2 GB ?

There are just two 2GB DIMMs populating two slots, and two empty slots. The memory module size seems wrong at 1GB. Later dmidecode "Memory module information" has correct "installed size" specified.

Code:
System is booted since Sat Apr 11 23:07:16 2009
Maybe better English to say "System is up since ..." or "System was booted on ..."

Code:
Currently mounted filesystems:
...
linprocfs on /usr/compat/linux/proc

WARNING: Not found in fstab(5): linprocfs on /usr/compat/linux/proc
It is in /etc/fstab, but as
linprocfs /compat/linux/proc linprocfs

Note: compat is linked to /usr/compat (I believe this is standard.)

Code:
Users in wheel group (allowed to use su(1)):
root
Other users are missing because they are not listed in /etc/groups. You need to also check /etc/passwd.

Code:
WARNING: bsdstats is supposed to be running, but it doesn't appear to.
"but it doesn't appear to." -> "but it isn't."

Of course, it is a one-shot script, so it'll probably never be running :)

Code:
Running services
...
winbindd is not running. <<<<<----- !!
...
Not running services

applix_lic_mgr is not running.
bsdstats is not running.
snmpd is not running.
snmptrapd is not running.
uuidd is not running.
wpa_supplicant is not running.
xfs is not running.
Ooops.

Otherwise, great improvement over the last version I tried 4 pages back :)
 

danger@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 332
Messages: 975

#81
trev said:
Version from /ports/sysutils (perhaps the first line of the output should include the version number?)
Try to run sysinfo with no arguments, that will display its version. The current version in ports is 1.0. Not sure if you run that though (see below).

Code:
RAM information

Memory information from dmidecode(8)
Maximum Memory Module Size: 1024 MB
Maximum Total Memory Size: 4096 MB
Maximum Capacity: 2 GB
Number Of Devices: 4
Why 4096 MB but then 2 GB ?

There are just two 2GB DIMMs populating two slots, and two empty slots. The memory module size seems wrong at 1GB. Later dmidecode "Memory module information" has correct "installed size" specified.
This appears like a bug in dmidecode(8). Could you please verify? In that case I cannot fix that for you :(

Code:
System is booted since Sat Apr 11 23:07:16 2009
Maybe better English to say "System is up since ..." or "System was booted on ..."
Fixed, thanks.

Code:
Currently mounted filesystems:
...
linprocfs on /usr/compat/linux/proc

WARNING: Not found in fstab(5): linprocfs on /usr/compat/linux/proc
It is in /etc/fstab, but as
linprocfs /compat/linux/proc linprocfs

Note: compat is linked to /usr/compat (I believe this is standard.)
I will look at this one this week.

Code:
Users in wheel group (allowed to use su(1)):
root
Other users are missing because they are not listed in /etc/groups. You need to also check /etc/passwd.
Heh. Nice one, thanks. I will implement this later this week. I usually don't set wheel group as my users' primary group.

Code:
WARNING: bsdstats is supposed to be running, but it doesn't appear to.
"but it doesn't appear to." -> "but it isn't."

Of course, it is a one-shot script, so it'll probably never be running :)
Language fixed. Yeah, I know about this problems with "services" which have rc.d scripts but actually are not a real services... I didn't come up to a proper solution yet :(

Code:
Running services
...
winbindd is not running. <<<<<----- !!
...
Not running services

applix_lic_mgr is not running.
bsdstats is not running.
snmpd is not running.
snmptrapd is not running.
uuidd is not running.
wpa_supplicant is not running.
xfs is not running.
Ooops.
Now that is interesting. I had a similar report in the past and I beleive that the current version should not have this bug. Could you please verify that you're actually running 1.0?

Otherwise, great improvement over the last version I tried 4 pages back :)
Thanks :)
You may want to run the script with -v as well :p
 

graudeejs

Son of Beastie

Thanks: 673
Messages: 4,617

#82
Code:
Currently loaded kernel modules (kldstat(8)):
zfs.ko
opensolaris.ko
geom_eli.ko
crypto.ko
zlib.ko
snd_ich.ko
sound.ko
acpi.ko
radeon.ko
drm.ko
agp.ko
WARNING: The zfs.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
WARNING: The opensolaris.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
WARNING: The crypto.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
WARNING: The zlib.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
WARNING: The sound.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
WARNING: The acpi.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
WARNING: The radeon.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
WARNING: The drm.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
WARNING: The agp.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
i boot from flash, and this loader.conf is not synced (just for the record)

Code:
Currently mounted filesystems:
/dev/ufs/root on /
devfs on /dev
sys/home on /home
sys/home/Archive on /home/Archive
sys/home/Archive/music on /home/Archive/music
data on /home/Files
data/torrents on /home/Files/torrents
sys/home/Share on /home/Share
sys/home/killasmurf86 on /home/killasmurf86
sys/jails on /jails
sys/jails/test on /jails/test
sys/tmp on /tmp
sys/usr_local on /usr/local
sys/usr_obj on /usr/obj
sys/usr_ports on /usr/ports
sys/usr_ports/distfiles on /usr/ports/distfiles
sys/usr_ports/packages on /usr/ports/packages
sys/usr_src on /usr/src
sys/var on /var

WARNING: Not found in fstab(5): sys/home on /home
WARNING: Not found in fstab(5): sys/home/Archive on /home/Archive
WARNING: Not found in fstab(5): sys/home/Archive/music on /home/Archive/music
WARNING: Not found in fstab(5): data on /home/Files
WARNING: Not found in fstab(5): data/torrents on /home/Files/torrents
WARNING: Not found in fstab(5): sys/home/Share on /home/Share
WARNING: Not found in fstab(5): sys/home/killasmurf86 on /home/killasmurf86
WARNING: Not found in fstab(5): sys/jails on /jails
WARNING: Not found in fstab(5): sys/jails/test on /jails/test
WARNING: Not found in fstab(5): sys/tmp on /tmp
WARNING: Not found in fstab(5): sys/usr_local on /usr/local
WARNING: Not found in fstab(5): sys/usr_obj on /usr/obj
WARNING: Not found in fstab(5): sys/usr_ports on /usr/ports
WARNING: Not found in fstab(5): sys/usr_ports/distfiles on /usr/ports/distfiles
WARNING: Not found in fstab(5): sys/usr_ports/packages on /usr/ports/packages
WARNING: Not found in fstab(5): sys/usr_src on /usr/src
WARNING: Not found in fstab(5): sys/var on /var
ZFS :D
you could check if zfs.ko is loaded, and then run
Code:
zpool status
zpool list
zfs list
and probably show warning that zfs is still experimental


Code:
Geli information
   Name  Status  Components
ad0.eli     N/A  ad0
ad4.eli     N/A  ad4
What should be in status? (just in case it's a bug)
They bough are mounted....

Code:
IPv4 addresses:
192.168.128.100 netmask 0xffffff00
192.168.128.99 netmask 0xffffff00
perhaps it's worth mentioning that 192.168.128.99 is alias


Code:
These users are allowed to use their own crontab:
root
at(1) can also be source of evil.
You should check it as well


This is output of sysinfo-1.0_1
 

trev

Aspiring Daemon

Thanks: 100
Messages: 587

#83
danger@ said:
Try to run sysinfo with no arguments, that will display its version. The current version in ports is 1.0. Not sure if you run that though (see below).
SysInfo v1.0 by Daniel Gerzo for FreeBSD Operating System

I could not even read this line on my LCD - bright cyan writing on a bright white background! Also outputting to files is nasty with those control sequences scattered throughout. Yes, I know, use another command line switch, but... not sure many programs default to colour output as they generally follow the principle that you shouldn't surprise your user without good reason, and colour is probably not a good reason and is not a Unix "convention", though it might be a Linux convention (in my very limited Linux experience).

This appears like a bug in dmidecode(8). Could you please verify? In that case I cannot fix that for you :(
I *think* the bug is yours. The 2GB DIMM uses 1Gb memory modules. The maximum total memory size is 4GB (ie max memory for a single slot). This is all correct. I think you are misinterpreting the information. The later dmidecode output is also correct, but is probably what you should be using to say what is actually installed. I hope I have explained it better this time :)

My other comment had to do with some output being in MB and some in GB. I was, subtly, suggesting you pick one and convert consistently to that. So, 4096MB -> 4GB, or 2GB -> 2048MB, but not some being in MB and some being in GB. Picky, I know, but I'm a lawyer and a programmer, and a former editor.

Yeah, I know about this problems with "services" which have rc.d scripts but actually are not a real services... I didn't come up to a proper solution yet :(
Is there not a hint in the scripts? For example:

# PROVIDE: bsdstats
# REQUIRE: LOGIN <<<<-----
# KEYWORD: shutdown

For services which do run all the time, is it not usually REQUIRE: DAEMON ?

Now that is interesting. I had a similar report in the past and I believe that the current version should not have this bug. Could you please verify that you're actually running 1.0?
Yep, I was running v1.0.
 

danger@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 332
Messages: 975

#84
trev said:
SysInfo v1.0 by Daniel Gerzo for FreeBSD Operating System

I could not even read this line on my LCD - bright cyan writing on a bright white background! Also outputting to files is nasty with those control sequences scattered throughout. Yes, I know, use another command line switch, but... not sure many programs default to colour output as they generally follow the principle that you shouldn't surprise your user without good reason, and colour is probably not a good reason and is not a Unix "convention", though it might be a Linux convention (in my very limited Linux experience).
Well I personally don't use white background in my terminal (it's always black) so I didn't realize this problem. However it is possible to disable the colorful output in the config file (/usr/local/etc/sysinfo.conf) if you don't want to use -c switch.

The colors are there mainly because it's easier to distinguish between sections of the output.

I *think* the bug is yours. The 2GB DIMM uses 1Gb memory modules. The maximum total memory size is 4GB (ie max memory for a single slot). This is all correct. I think you are misinterpreting the information. The later dmidecode output is also correct, but is probably what you should be using to say what is actually installed. I hope I have explained it better this time :)
I will need to check further details.

My other comment had to do with some output being in MB and some in GB. I was, subtly, suggesting you pick one and convert consistently to that. So, 4096MB -> 4GB, or 2GB -> 2048MB, but not some being in MB and some being in GB. Picky, I know, but I'm a lawyer and a programmer, and a former editor.
I currently have no plans in changing this :)

Is there not a hint in the scripts? For example:

# PROVIDE: bsdstats
# REQUIRE: LOGIN <<<<-----
# KEYWORD: shutdown

For services which do run all the time, is it not usually REQUIRE: DAEMON ?
Not really:

Code:
root@[lightstorm /data/jails/hosting.cia.sk/www/hmc.sk/www]# grep REQUIRE /services/usr/local/etc/rc.d/*
/services/usr/local/etc/rc.d/amavisd:# REQUIRE: LOGIN
/services/usr/local/etc/rc.d/clamav-clamd:# REQUIRE: LOGIN
/services/usr/local/etc/rc.d/clamav-freshclam:# REQUIRE: LOGIN clamd
/services/usr/local/etc/rc.d/dovecot:# REQUIRE: LOGIN mysql
/services/usr/local/etc/rc.d/mysql-server:# REQUIRE: LOGIN
/services/usr/local/etc/rc.d/postfix:# REQUIRE: LOGIN cleanvar mysql
/services/usr/local/etc/rc.d/postgrey:# REQUIRE: LOGIN
/services/usr/local/etc/rc.d/rsyncd:# REQUIRE: LOGIN
/services/usr/local/etc/rc.d/sa-spamd:# REQUIRE: LOGIN
Yep, I was running v1.0.
Well that's interesting. I will check then what's going on.
 

vermaden

Son of Beastie

Thanks: 985
Messages: 2,645

#85
I would like to mention some bugs/suggestions:

version: sysinfo-1.0.1

Code:
CPU usage statistics:
CPU: [3;6H 0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
Color even with -c in that section.

Code:
WARNING: Your CPU supports amd64 architecture, however you are running i386.
WARNING: You may want to switch to amd64 to get a better performance.
... and miss WINE and some MPLAYER codecs, FLASH and more, rather useless WARNING.


Code:
WARNING: The linprocfs.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
Its loaded automatically when you mount linprocfs from /etc/fstab, no need for /boot/loader.conf entry.

Code:
WARNING: The linux.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
Can be also set in /etc/rc.conf by linux_enable="YES"

Code:
WARNING: The wpifw.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
Its loaded by if_wpi.ko, no need for entry.

Code:
WARNING: The i915.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
WARNING: The drm.ko module is loaded, however it is not being loaded upon the system boot time from /boot/loader.conf.
These two are loaded automatically by starting xorg.

Code:
WARNING: inetd(8) is enabled, however none of its services are enabled. Check /etc/inetd.conf.
Its not enabled and its not running.

Code:
WARNING: dmesg is supposed to be running, but it isn't.
WARNING: mixer is supposed to be running, but it isn't.
WARNING: virecover is supposed to be running, but it isn't.
Supossed to? What for?

Code:
WARNING: moused is supposed to be running, but it isn't.
WARNING: powerd is supposed to be running, but it isn't.
WARNING: sshd is supposed to be running, but it isn't.
WARNING: syslogd is supposed to be running, but it isn't.
WARNING: devd is supposed to be running, but it isn't.
They are running.

Code:
abi is not running.
addswap is not running.
adjkerntz is not running.
archdep is not running.
auto_linklocal is not running.
automounter is not running.
avahi_daemon is not running.
avahi_dnsconfd is not running.
background-fsck is not running.
bluetooth is not running.
bridge is not running.
Useless, most scripts start and end their job.

Regards.
 

tiko

Member

Thanks: 2
Messages: 32

#86
Hi,

Is this no longer available from the author (the link is obviously 404)? If so, does anyone have a copy online they could share?
 

vermaden

Son of Beastie

Thanks: 985
Messages: 2,645

#87
@tiko

Use the Ports Luke:
Code:
% cat /usr/ports/sysutils/sysinfo/pkg-descr

Sysinfo is a shell script, the purpose of which is to automatically
gather system information and document the hardware and software
configuration of the given host system. The goal is to provide a
system operator with descriptive information about an unknown FreeBSD
installation.

WWW: http://forums.freebsd.org/showthread.php?t=3282
 

Vovas

Member

Thanks: 1
Messages: 47

#88
Thanks for a very useful port!

And one question. Could you add new pkg2ng functionality? Now the tool is using old pkg_info:
Code:
pkg_version: the package info for package 'yasm-1.2.0' is corrupt
pkg_version: the package info for package 'zfs-stats-1.2.2' is corrupt
pkg_version: the package info for package 'zip-3.0' is corrupt
 

Freitase

New Member


Messages: 3

#89
I noticed some people have the following error and I had it as well on precisely one of my boxes.

Code:
root@mybox:~ # sysinfo services
Generated by SysInfo v1.0.1 by Daniel Gerzo

Information related to services


WARNING: nagios is supposed to be running, but it isn't.
WARNING: nginx is supposed to be running, but it isn't.
WARNING: nsca is supposed to be running, but it isn't.
WARNING: supervisord is supposed to be running, but it isn't.
WARNING: cleanvar is supposed to be running, but it isn't.
WARNING: cron is supposed to be running, but it isn't.
WARNING: devd is supposed to be running, but it isn't.
WARNING: dmesg is supposed to be running, but it isn't.
WARNING: gptboot is supposed to be running, but it isn't.
WARNING: hostid is supposed to be running, but it isn't.
kenv: unable to get dhcp.host-name
WARNING: inetd is supposed to be running, but it isn't.
WARNING: mixer is supposed to be running, but it isn't.
WARNING: ntpd is supposed to be running, but it isn't.
WARNING: pflog is supposed to be running, but it isn't.
WARNING: sshd is supposed to be running, but it isn't.
WARNING: syslogd is supposed to be running, but it isn't.
WARNING: virecover is supposed to be running, but it isn't.
But they ARE running:
Code:
root@mybox:~ # /usr/local/etc/rc.d/nagios status
nagios is running as pid 31973.
So I tried this in /usr/local/share/sysinfo/modules/services
Code:
...
run_rc_script()
{
    ...
    local _file _arg
    _file=$1
    _arg=$2
  
    #HERE I added the next line HERE
    unset procname
    ...
}
...
tried again and voila:
Code:
root@mybox:~ # sysinfo services
Generated by SysInfo v1.0.1 by Daniel Gerzo

Information related to services

WARNING: nsca is supposed to be running, but it isn't.

Running services

cron is running as pid 1028.
devd is running as pid 638.
fcgiwrap is running as pid 32032.
inetd is running as pid 1044.
nagios is running as pid 31973.
nfsd is running as pid 882 884.
nginx is running as pid 31995.
ntpd is running as pid 936.
pflog is running as pid 657.
sshd is running as pid 1016.
supervisord is running as pid 31948.
syslogd is running as pid 804.
Yay. Nsca is really not running, so everything is ok now.

I got the idea to unset procname when I had a look at run_rc_script() in /etc/rc.subr. But I do not know why exactly this would fix the problem and if there is potential harm coming from this. Can someone enlighten me/us, please?
 
Top