# System Info Tool



## Phishfry (Dec 26, 2016)

One FreeBSD tool I find invaluable is sysutils/sysinfo. It really is a nice set of scripts that show system details in an easily readable form.
`sysinfo -a` runs all scripts.

I don't see it mentioned much here and thought I would draw attention to it as it makes for a great troubleshooter.


----------



## Phishfry (Dec 26, 2016)

The sysinfo packages script could use a refresh. It is using older pkg_info command.
Would be nice to show `pkg -leaf` instead of `pkg info`


----------



## chrbr (Dec 26, 2016)

Dear Phishfry, 
the port looks interesting. In my opinion the changes would be

replace the old pkg commands with the new ones
add svnlite as a tool to upgrade the ports tree
replace portaudit by pkg audit
I am not sure if ports-mgmt/jailaudit should be mentioned. If not I could propose a PR and patch.


----------



## Phishfry (Dec 26, 2016)

Pretty awesome. I was messing with the sysinfo packages script just to see what I could do.
His script gets a list of packages and shows the total number and then shows version and the number of packages that are out of date. A little more complicated than I had imagined.


----------



## chrbr (Dec 27, 2016)

Dear Phishfry,
I have made a patch and asked the author and maintainer about his opinion and for advice how to proceed.


----------



## danger@ (Jan 2, 2017)

Hi guys, I am a bit surprised that someone is still using my tool that I created as a little school project  I suggest to chrbr to publish his patch (it looks OK from a quick glance) that he sent to me here until I find time and determination to update the port itself


----------



## chrbr (Jan 2, 2017)

Dear danger@,
thank you for the reply. The good old times never end. Below is the patch to be stored as /usr/ports/sysutils/sysinfo/files/patch-modules_packages

```
/usr/ports/sysutils/sysinfo/files # cat patch-modules_packages
--- modules/packages.orig       2009-05-21 17:13:53 UTC
+++ modules/packages
@@ -7,32 +7,28 @@ APPDIR=${APPDIR:-..}

 sect "Packages information";

-NUMP=`pkg_info | wc -l | awk '{print $1}'`
-OUTD=`pkg_version -Iv | grep -c "needs updating"`
+NUMP=`pkg info | wc -l | awk '{print $1}'`
+OUTD=`pkg version -Iv | grep -c "needs updating"`

 echo -e "There are $NUMP packages installed in the system and $OUTD of them needs updating."
 echo -e "${C_BOLD_S}Note that this number may be inaccurate, as your ports tree may be outdated too.${C_BOLD_E}\n"

 if is_verbose 1; then
-       pkg_info
+       pkg info
        echo
 else
-       info "Run pkg_info(1) to see a full list of installed packages."
+       info "Run pkg info(1) to see a full list of installed packages."
 fi

-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."
+info "Use pkg version(1) to inspect what packages are outdated."
+info "Use the portsnap(8), svnlite(1) or csup(1) tool to update your ports tree."

 echo

-if which -s portaudit; then
-       subsect "Packages with known security vulnerabilities:"
-       portaudit -a
-       echo -e "\n${C_BOLD_S}Note that this information may be inaccurate, \
-as the portaudit(1) database may be outdated.${C_BOLD_E}\n"
-else
-       warn "You should install the portaudit(1) tool in order to get information \
-about known security vulnerabilities in your packages."
-fi
+subsect "Packages with known security vulnerabilities:"
+pkg audit
+echo -e "\n${C_BOLD_S}Note that this information may be inaccurate, \
+as the database may be outdated. Run pkg audit -F to update the database before the audit.${C_BOLD_E}\n"
+warn "Jails are not checked."

 exit 0
```
Edit: Copy and paste might have distorted the file. The lines with -, + and @ start at the first column of the line. All others including empty lines have a leading space. If anyone want to try the patch and can not make it work please let me know. Then email might be a better way for distribution.
Edit: A checksum for verification is as below

```
# sha256 patch-modules_packages
SHA256 (patch-modules_packages) = c5d929fe13d3e9787fe29f4fd83485c26ce4406df628f7e4b389c74de2176102
```


----------



## Phishfry (Jan 2, 2017)

I grew up on MS-DOS and found the program Check-It a great tool. This was back in the day of I/O cards for serial and parallel ports where you had to set the I/O cards jumpers for an available base address. I would like to see a similar utility for FreeBSD. The sysinfo script does combine machine information in a very usable fashion. Sure would make a nice a ncurses program.

http://www.danielsays.com/ss-gallery-dos-check-it-201.html


----------



## lme@ (Jan 4, 2017)

danger@ said:


> Hi guys, I am a bit surprised that someone is still using my tool that I created as a little school project  I suggest to chrbr to publish his patch (it looks OK from a quick glance) that he sent to me here until I find time and determination to update the port itself


But it is still a very useful tool. You should keep on maintaining it.


----------

