Simple question to get information from linux

Hi guys,

is there a command line or smart programming way in linux to get the following information about the system

The country
The Language
the Time Zone ( the more verbose the better)
Number of Processes
Free space on Volume(0) or home/ drive
Current CPU usage

Any other information along the same paths.

Thanks
Damon

If plugins are an option then there is the LinuxSysInfoMBS class:
http://www.monkeybreadsoftware.net/class-linuxsysinfombs.shtml

Check out the projects in the MBS plugins example folders:
/Main/Web Edition Examples/Infos
/Util/Linux SysInfo

In his web example Christian is using a mix of built-in Xojo methods and from what is lacking he is using his plugins. See code example here:
http://www.monkeybreadsoftware.net/example-main-webeditionexamples-infos.shtml

Hi Oliver,

I will have a look , many thanks

Damon

Here are some I have found

Dim s,q as string
Dim sh as new shell

s=s+"Language :"
sh.Execute "set | egrep '^(LANG|LC_)'"
q=sh.Result
q=NthField(q,"=",2)
q=trim(q)
s=s+q+EndOfLine

s=s+"Computer name : "
sh.Execute "hostname"
q=sh.Result
s=s+trim(q)+EndOfLine

s=s+"Number of processors : "
sh.Execute "cat /proc/cpuinfo | grep vendor_id | wc -l"
q=sh.Result
q=trim(q)
s=s+q+endofline

s=s+"Volume(0) free space : "
sh.Execute "df -h"
q=sh.Result
q=NthField(q,chr(10),2)
q=mid(q,27,6)
s=s+q+"B"+endofline

will give you something like this

Language :en_AU.UTF-8
Computer name : damon-Linux
Number of processors : 2
Volume(0) free space : 22GB

thanks
damon

[quote=88833:@damon pillinger]Hi guys,

is there a command line or smart programming way in linux to get the following information about the system

The country
The Language
the Time Zone ( the more verbose the better)
Number of Processes
Free space on Volume(0) or home/ drive
Current CPU usage
[/quote]

A lot of information can be accessed from the command line. I have found linuxquestions.org to be a good resource. You have already posted about ps for the number of processes.

The country is not so simple. You cannot rely on the user entry so much, as one may decide on his system setting different from his actual country for personal reasons. You could probably find that out by geolocalizing his Internet access.

Timezone is displayed by date.

Free space, found this : http://www.cyberciti.biz/faq/check-free-space/

CPU usage : http://www.cyberciti.biz/faq/unix-command-to-find-cpu-utilization/

Hi Michel,

thanks for all the info, I have looked at the links and found exactly what I needed.

many thanks

Damon

Not to forget all the info provided by the /proc directory tree. Find informations like number of cpus, irqs, dmas, drivers, devices asf.

And all info in tree/text format