Difference between revisions of "OE info Script"

From wiki.emacinc.com
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{todo| InProgress (12.08.2015-12:26->JJ+)|Jeffrey Jung| project=OE 5.0,JJ,InProgress }}
+
{{todo| Review (12.08.2015-12:26->JJ+)|Jeffrey Jung| project=OE 5.0,JJ,MD,MG, Review }}
 
{{#seo:
 
{{#seo:
 
|title=OE Info Script
 
|title=OE Info Script
Line 10: Line 10:
 
<!-- /****************************************  Page Description Text  ****************************************/ -->
 
<!-- /****************************************  Page Description Text  ****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
<span style="background:#00FF00;color:#FF0000;font-size:300%">'''''Put the page description text here.'''''</span>
+
<!--<span style="background:#00FF00;color:#FF0000;font-size:300%">'''''Put the page description text here.'''''</span> -->
 
+
This page will explain the standard operations of the <code>/usr/bin/oe_info.sh</code> script, as well as its other capabilities.
 
__TOC__
 
__TOC__
  
Line 18: Line 18:
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
{{:Templateimpl:bg | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
 
{{:Templateimpl:bg | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
 
+
Provided in all EMAC systems is a executable <code>/usr/bin/oe_info.sh</code> that will display various amounts of information ranging from the version of the filesystem to presenting real-time memory utilization.
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*****************************************  General Information  *****************************************/ -->
 
<!-- /*****************************************  General Information  *****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
{{:Templateimpl:geninfo | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
 
{{:Templateimpl:geninfo | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
 +
 +
The default operation of the script is to provide information about the system. This includes:
 +
* Name of the device
 +
* Device serial number
 +
* Bootstrap
 +
* Bootloader Version
 +
* Kernel version
 +
* Filesystem version
 +
 +
The output of the script will be saved to the text file <code>/etc/oe_info</code>, but only if the file system has been mounted with write permissions. To do this, simply run {{icli|mount -o remount,rw /}} before invoking the <code>oe_info</code> script.
 +
 +
The contents of the <code>/etc/oe_info</code> file will be written in, line-by-line, to <code>/www/pages/oe_info.html</code>. This html document is part of the web server provided on all EMAC devices. To access the page, connect the device to a network and determine its IP address. Enter the IP address to a web browser on the same network and you'll be brought to the homepage of the web server. Go to the OE_INFO tab to view the content of <code>/etc/oe_info</code> within the web browser. If there was an error reading from <code>/etc/oe_info</code>, then the webpage will display an empty box.
 +
<br/>
 +
Here is an example of what the default, no options passed, output of the script looks like:
 +
{{clop|indent=2}}
 +
{{cliop|/usr/bin/oe_info.sh  | hostname=ipac9x25}}
 +
 +
<nowiki>####################################################
 +
####################################################</nowiki><br/>
 +
Gathering build information...<br/>
 +
Product: ipac9x25
 +
Serial Number: R078000001<br/>
 +
Bootstrap: AT91Bootstrap 3.5.3<br/>
 +
Bootloader Part# U-Boot 2014.07emac-standard
 +
Bootloader Ver#: U-Boot 2014.07emac-standard<br/>
 +
Kernel Part#: 3.10.0-emac-standard+c0218784c0
 +
Kernel Ver#: 3.10.0-emac-standard+c0218784c0<br/>
 +
Filesystem Part#: Standard image
 +
Filesystem Ver#: 5.0.3
 +
 +
<nowiki>####################################################
 +
####################################################</nowiki><br/>
 +
{{cliop||hostname=ipac9x25}}{{closp}}
 +
 +
  
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
Line 28: Line 63:
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
{{:Templateimpl:using | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
 
{{:Templateimpl:using | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
 +
Usage of the script is as follows:
 +
<pre>
 +
/usr/bin/oe_info.sh [option]
 +
</pre>
 +
Only one option will be evaluated and there are no parameters for these options. For example, running {{icli| /usr/bin/oe_info.sh -cn}} will only evaluate <code>c</code> as the option. Similarly, {{icli| /usr/bin/oe_info.sh -c 123}} will not account for <code>123</code> as a parameter and just execute with the <code>c</code> option. These options are explained in the following section.
 +
 +
== Options ==
 +
The script allows for <code>-c, -f, -h, -m, -n, -v</code> as options and to be only identified by a single dash ('-'). An invalid option or improper amount of dashes will yield an error and display the proper usage with a list of valid options. When an option is given, the script will perform the desired task and then exit. The system information presented when no option given will not be shown and the <code>/www/pages/oe_info.html</code> will not be updated.
 +
 +
=== -c, CPU Infomation ===
 +
This will display the number of CPU cores and threads, the chip architecture with the model name, real-time CPU utilization, and CPU clock speed.
 +
 +
{{clop | indent=2}}
 +
{{cliop| /usr/bin/oe_info.sh -c | hostname=ipac9x25}}
 +
CPU info:
 +
<br />
 +
BogoMIPS : 198.76
 +
Architecture: ARM, Atmel AT91SAM (Device Tree)
 +
Number of CPUs: 1 core(s)
 +
CPU Utilization: 0.5%
 +
Clock speed: 400 MHz
 +
{{cliop||hostname=ipac9x25}}{{closp}}
 +
 +
<br />
 +
 +
=== -f, Flash Information ===
 +
The <code>-f</code> option will show how much space is used and available on the filesystem and display a list of partitions on the system.
 +
 +
{{clop|indent=2}}
 +
{{cliop| /usr/bin/oe_info.sh -f| hostname=ipac9x25}}
 +
Flash Info:
 +
<br/>
 +
Filesystem          Size        Used  Available  Use% Mounted on
 +
/dev/root          922.7M      71.6M    787.4M    8% /
 +
devtmpfs            60.9M      4.0K      60.9M    0% /dev
 +
/dev/mmcblk0p2      2.5G      4.0M      2.3G    0% /home
 +
 +
tmpfs              61.0M    172.0K      60.9K    0% /run
 +
tmpfs              61.0M      28.0K      61.0M    0% /var/volatile
 +
<br/>
 +
Partitions:
 +
major minor  #blocks  name
 +
<nowiki> </nowiki>31        0      16384 mtdblock0
 +
179        0    3694592 mmcblk0
 +
179        1    976600 mmcklk0p1
 +
179        2    2717984 mmcblk0p2
 +
179        16      16384 mmcblk0boot1
 +
179        8      16384 mmcblk0boot0
 +
{{cliop||hostname=ipac9x25}}{{closp}}
 +
 +
=== -m, Memory Information ===
 +
Show the total, used, and free memory of the system.
 +
 +
{{clop|indent=2}}
 +
{{cliop|/usr/bin/oe_info.sh -m|hostname=ipac9x25}}
 +
Memory Info:
 +
<br/>
 +
Total: 122M
 +
Used:  15M
 +
Free:  82M
 +
{{cliop||hostname=ipac9x25}}{{closp}}
 +
 +
=== -n, Network Information ===
 +
For every site connected to a network, its IP address, netmask, gateway, hostname and MAC address will be displayed.
 +
 +
{{clop|indent=2}}
 +
{{cliop|/usr/bin/oe_info.sh -n|hostname=ipac9x25}}
 +
Network Info:
 +
<br/>
 +
Connection at eth0
 +
IP address:  10.03.146
 +
Netmask:    255.255.0.0
 +
Gateway:    10.0.2.1
 +
Hostname:    ipac9x25
 +
MAC address: 40:D8:55:19:DC:C4
 +
<br />
 +
Connection at wlan0
 +
IP address:  10.0.4.148
 +
Netmask:    255.255.0.0
 +
Gateway:    10.0.2.1
 +
Hostname:    ipac9x25
 +
MAC address: A8:54:B2:42:89:8D
 +
{{cliop||hostname=ipac9x25}}{{closp}}
 +
 +
 +
=== -v, Invoke All Options ===
 +
The <code>-v</code> option will act as if repeatedly running the script with <code>c, f, m, n</code> options.
 +
{{clop|indent=2}}
 +
{{cliop|/usr/bin/oe_info.sh -v|hostename=ipac9x25}}
 +
CPU info
 +
<br />
 +
BogoMIPS : 198.76
 +
Architecture: ARM, Atmel AT91SAM (Device Tree)
 +
Number of CPUs: 1 core(s)
 +
CPU Utilization:  0.4 %
 +
Clock speed: error reading cpuinfo and dmesg for clock speed<br />
 +
Flash Info:
 +
<br />
 +
Filesystem                Size      Used Available Use% Mounted on
 +
/dev/root              922.7M    71.6M    787.4M  8% /
 +
devtmpfs                60.9M      4.0K    60.9M  0% /dev
 +
/dev/mmcblk0p2            2.5G      4.0M      2.3G  0% /home
 +
tmpfs                    61.0M    172.0K    60.9M  0% /run
 +
tmpfs                    61.0M    28.0K    61.0M  0% /var/volatile
 +
<br />
 +
Partitions:
 +
major minor  #blocks  name<br />
 +
<nowiki> </nowiki>31        0      16384 mtdblock0
 +
179        0    3694592 mmcblk0
 +
179        1    976600 mmcblk0p1
 +
179        2    2717984 mmcblk0p2
 +
179      16      16384 mmcblk0boot1
 +
179        8      16384 mmcblk0boot0
 +
<br />
 +
Memory Info:
 +
<br />
 +
Total: 122M
 +
Used:  15M
 +
Free:  82M
 +
<br/>
 +
Network Info:
 +
<br/>Connection at eth0
 +
IP address:  10.0.3.146
 +
Netmask:    255.255.0.0
 +
Gateway:    10.0.2.1
 +
Hostname:    ipac9x25
 +
MAC address: 40:D8:55:19:DC:C4
 +
<br />
 +
Connection at wlan0
 +
IP address:  10.0.4.148
 +
Netmask:    255.255.0.0
 +
Gateway:    10.0.2.1
 +
Hostname:    ipac9x25
 +
MAC address: A8:54:B2:42:89:8D
 +
{{cliop||hostname=ipac9x25}}{{closp}}
 +
 +
=== -h, Help ===
 +
Display the usage of the script and list the options and their descriptions.
 +
 +
{{clop|indent=2}}
 +
{{cliop|/usr/bin/oe_info.sh -h|hostname=ipac9x25}}
 +
USAGE:
 +
::oe_info.sh [option]
 +
OPTIONS:
 +
::-c show cpu info
 +
::  Display number of CPUs, BogoMIPS, chip arhitecture, CPU utilization, and CPU clock speed
 +
::-f flash info
 +
::  Shows how much space is used and available on the filesystem and provides a list of
 +
::  partitions found int /proc/partitions
 +
::-m show memory info
 +
::  Display space used and available in main memory
 +
::-n network info
 +
::-v invoke all options above
 +
::-h display usage and options list
 +
{{cliop||hostname=ipac9x25}}{{closp}}
  
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*****************************************      Examples        *****************************************/ -->
 
<!-- /*****************************************      Examples        *****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
{{:Templateimpl:examples | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
+
<!-- {{:Templateimpl:examples | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }} -->
  
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
Line 38: Line 228:
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
{{:Templateimpl:conclusion | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
 
{{:Templateimpl:conclusion | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
 
+
This script is a very useful tool when wanting to know specific information quickly. Instead of looking within the print out of <code>ifconfig</code> to determine the IP address, <code>oe_info.sh</code> can present this information in an easier to read mannor
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /******************************************  More Information  *****************************************/ -->
 
<!-- /******************************************  More Information  *****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
{{:Templateimpl:moreinfo | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
 
{{:Templateimpl:moreinfo | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
*  
+
* Not really sure what would be good to include here.
  
 
{{:Templateimpl:whatnext | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
 
{{:Templateimpl:whatnext | initials=JJ | title=OE Info Script | desc=Description of Procedures and Features of The Script | project=OE 5.0 }}
*
+
* Not really sure what would be good to include here.

Latest revision as of 15:30, 8 December 2015

TODO: {{#todo: Review (12.08.2015-12:26->JJ+)|Jeffrey Jung|OE 5.0,JJ,MD,MG, Review}}

This page will explain the standard operations of the /usr/bin/oe_info.sh script, as well as its other capabilities.

Background

Provided in all EMAC systems is a executable /usr/bin/oe_info.sh that will display various amounts of information ranging from the version of the filesystem to presenting real-time memory utilization.

General Information

The default operation of the script is to provide information about the system. This includes:

  • Name of the device
  • Device serial number
  • Bootstrap
  • Bootloader Version
  • Kernel version
  • Filesystem version

The output of the script will be saved to the text file /etc/oe_info, but only if the file system has been mounted with write permissions. To do this, simply run root@som9x25:~# mount -o remount,rw / before invoking the oe_info script.

The contents of the /etc/oe_info file will be written in, line-by-line, to /www/pages/oe_info.html. This html document is part of the web server provided on all EMAC devices. To access the page, connect the device to a network and determine its IP address. Enter the IP address to a web browser on the same network and you'll be brought to the homepage of the web server. Go to the OE_INFO tab to view the content of /etc/oe_info within the web browser. If there was an error reading from /etc/oe_info, then the webpage will display an empty box.
Here is an example of what the default, no options passed, output of the script looks like:

root@ipac9x25:~# /usr/bin/oe_info.sh

#################################################### ####################################################
Gathering build information...
Product: ipac9x25 Serial Number: R078000001
Bootstrap: AT91Bootstrap 3.5.3
Bootloader Part# U-Boot 2014.07emac-standard Bootloader Ver#: U-Boot 2014.07emac-standard
Kernel Part#: 3.10.0-emac-standard+c0218784c0 Kernel Ver#: 3.10.0-emac-standard+c0218784c0
Filesystem Part#: Standard image Filesystem Ver#: 5.0.3

#################################################### ####################################################

root@ipac9x25:~#


OE Info Script

Usage of the script is as follows:

/usr/bin/oe_info.sh [option]

Only one option will be evaluated and there are no parameters for these options. For example, running root@som9x25:~# /usr/bin/oe_info.sh -cn will only evaluate c as the option. Similarly, root@som9x25:~# /usr/bin/oe_info.sh -c 123 will not account for 123 as a parameter and just execute with the c option. These options are explained in the following section.

Options

The script allows for -c, -f, -h, -m, -n, -v as options and to be only identified by a single dash ('-'). An invalid option or improper amount of dashes will yield an error and display the proper usage with a list of valid options. When an option is given, the script will perform the desired task and then exit. The system information presented when no option given will not be shown and the /www/pages/oe_info.html will not be updated.

-c, CPU Infomation

This will display the number of CPU cores and threads, the chip architecture with the model name, real-time CPU utilization, and CPU clock speed.

root@ipac9x25:~# /usr/bin/oe_info.sh -c

CPU info:
BogoMIPS : 198.76 Architecture: ARM, Atmel AT91SAM (Device Tree) Number of CPUs: 1 core(s) CPU Utilization: 0.5% Clock speed: 400 MHz

root@ipac9x25:~#


-f, Flash Information

The -f option will show how much space is used and available on the filesystem and display a list of partitions on the system.

root@ipac9x25:~# /usr/bin/oe_info.sh -f

Flash Info:
Filesystem Size Used Available Use% Mounted on /dev/root 922.7M 71.6M 787.4M 8% / devtmpfs 60.9M 4.0K 60.9M 0% /dev /dev/mmcblk0p2 2.5G 4.0M 2.3G 0% /home

tmpfs 61.0M 172.0K 60.9K 0% /run tmpfs 61.0M 28.0K 61.0M 0% /var/volatile
Partitions: major minor #blocks name 31 0 16384 mtdblock0 179 0 3694592 mmcblk0 179 1 976600 mmcklk0p1 179 2 2717984 mmcblk0p2 179 16 16384 mmcblk0boot1 179 8 16384 mmcblk0boot0

root@ipac9x25:~#

-m, Memory Information

Show the total, used, and free memory of the system.

root@ipac9x25:~# /usr/bin/oe_info.sh -m

Memory Info:
Total: 122M Used: 15M Free: 82M

root@ipac9x25:~#

-n, Network Information

For every site connected to a network, its IP address, netmask, gateway, hostname and MAC address will be displayed.

root@ipac9x25:~# /usr/bin/oe_info.sh -n

Network Info:
Connection at eth0 IP address: 10.03.146 Netmask: 255.255.0.0 Gateway: 10.0.2.1 Hostname: ipac9x25 MAC address: 40:D8:55:19:DC:C4
Connection at wlan0 IP address: 10.0.4.148 Netmask: 255.255.0.0 Gateway: 10.0.2.1 Hostname: ipac9x25 MAC address: A8:54:B2:42:89:8D

root@ipac9x25:~#


-v, Invoke All Options

The -v option will act as if repeatedly running the script with c, f, m, n options.

root@som9x25:~# /usr/bin/oe_info.sh -v

CPU info
BogoMIPS : 198.76 Architecture: ARM, Atmel AT91SAM (Device Tree) Number of CPUs: 1 core(s) CPU Utilization: 0.4 % Clock speed: error reading cpuinfo and dmesg for clock speed
Flash Info:
Filesystem Size Used Available Use% Mounted on /dev/root 922.7M 71.6M 787.4M 8% / devtmpfs 60.9M 4.0K 60.9M 0% /dev /dev/mmcblk0p2 2.5G 4.0M 2.3G 0% /home tmpfs 61.0M 172.0K 60.9M 0% /run tmpfs 61.0M 28.0K 61.0M 0% /var/volatile
Partitions: major minor #blocks name
31 0 16384 mtdblock0 179 0 3694592 mmcblk0 179 1 976600 mmcblk0p1 179 2 2717984 mmcblk0p2 179 16 16384 mmcblk0boot1 179 8 16384 mmcblk0boot0
Memory Info:
Total: 122M Used: 15M Free: 82M
Network Info:
Connection at eth0 IP address: 10.0.3.146 Netmask: 255.255.0.0 Gateway: 10.0.2.1 Hostname: ipac9x25 MAC address: 40:D8:55:19:DC:C4
Connection at wlan0 IP address: 10.0.4.148 Netmask: 255.255.0.0 Gateway: 10.0.2.1 Hostname: ipac9x25 MAC address: A8:54:B2:42:89:8D

root@ipac9x25:~#

-h, Help

Display the usage of the script and list the options and their descriptions.

root@ipac9x25:~# /usr/bin/oe_info.sh -h

USAGE:

oe_info.sh [option]

OPTIONS:

-c show cpu info
Display number of CPUs, BogoMIPS, chip arhitecture, CPU utilization, and CPU clock speed
-f flash info
Shows how much space is used and available on the filesystem and provides a list of
partitions found int /proc/partitions
-m show memory info
Display space used and available in main memory
-n network info
-v invoke all options above
-h display usage and options list
root@ipac9x25:~#


Conclusion

This script is a very useful tool when wanting to know specific information quickly. Instead of looking within the print out of ifconfig to determine the IP address, oe_info.sh can present this information in an easier to read mannor

Further Information

Where to Go Next
  • Not really sure what would be good to include here.
Pages with Related Content
  • Not really sure what would be good to include here.