Thursday, November 20, 2014

Smartctl – Monitoring & Analysis tool for Hard drive

http://www.linuxtechi.com/smartctl-monitoring-analysis-tool-hard-drive

Smartctl (Self-Monitoring, Analysis and Reporting Technology) is a command line utility or a tool in UNIX like operating system that perform SMART tasks such as printing the SMART self-test and error logs, enabling and disabling SMART automatic testing, and initiating device self-tests.
Smartctl is useful on physical Linux servers where smart disks can be checked for errors and extract info regarding the disks that are used behind the Hardware RAID.
In this post we will discuss some practical examples of smartctl command, Use below steps to install smartctl , if it is not installed on your linux box.

Installation of Smartcl in Ubuntu

$ sudo apt-get install smartmontools

Installation of Smartcl in Redhat / CentOS

# yum install smartmontools
Start the Smartctl Service
For Ubuntu
$ sudo /etc/init.d/smartmontools start
For CentOS & RHEL
# service smartd start ; chkconfig smartd on
Example:1 Check Whether Smart Capability is enabled or not for the disk
root@linuxtechi:~# smartctl -i /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Momentus 5400.6
Device Model:     ST9320325AS
Serial Number:    5VD2V59T
LU WWN Device Id: 5 000c50 020a37ec4
Firmware Version: 0002BSM1
User Capacity:    320,072,933,376 bytes [320 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    5400 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 2.6, 1.5 Gb/s
Local Time is:    Sun Nov 16 12:32:09 2014 IST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Where ‘/dev/sdb’ is your hard disk. Last Two lines in above output shows that SMART  capability is enable for the device.
Example:2 Enable Smart Capability for the disk
root@linuxtechi:~# smartctl -s on /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.
Example:3 Disable Smart Capability for the disk
root@linuxtechi:~# smartctl -s off  /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Disabled. Use option -s with argument 'on' to enable it.
Example:4 Display Detailed Smart info for the disk
root@linuxtechi:~# smartctl -a /dev/sdb              // For IDE drive
root@linuxtechi:~# smartctl -a -d ata /dev/sdb       // For SATA drive
Example:5 Display Overall health of the Disk
root@linuxtechi:~# smartctl -H  /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.
Please note the following marginal Attributes:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
190 Airflow_Temperature_Cel 0x0022   067   045   045    Old_age   Always   In_the_past 33 (Min/Max 25/33)
Example:6 Test Hard drive using long & short option.
Long Test
root@linuxtechi:~# smartctl --test=long /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 102 minutes for test to complete.
Test will complete after Sun Nov 16 14:29:43 2014

Use smartctl -X to abort test.
OR We can redirect test output to a log file , as shown below
root@linuxtechi:~# smartctl --test=long /dev/sdb > /var/log/long.text
Short Test
root@linuxtechi:~# smartctl --test=short /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Sun Nov 16 12:51:45 2014

Use smartctl -X to abort test.
OR
root@linuxtechi:~# smartctl --test=short /dev/sdb > /var/log/short.text
Note : Short test will take maximum 2 minutes whereas in long test there is no time restriction because it read & verify every segment of the entire disk.
Example:7 To View Drive’s Self Test result
root@linuxtechi:~# smartctl -l selftest /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed: read failure       90%       492         210841222
# 2  Extended offline    Completed: read failure       90%       492         210841222
Example:8 Calculate Estimate time to perform test
root@linuxtechi:~# smartctl -c  /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
General SMART Values:
Offline data collection status:  (0x00)    Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      ( 121)    The previous self-test completed having
                    the read element of the test failed.
Total time to complete Offline 
data collection:         (    0) seconds.
Offline data collection
capabilities:              (0x73) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    No Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003)    Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01)    Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:      (   1) minutes.
Extended self-test routine
recommended polling time:      ( 102) minutes.
Conveyance self-test routine
recommended polling time:      (   2) minutes.
SCT capabilities:            (0x103b)    SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.
Example:9 Display Error logs of the disk
root@linuxtechi:~# smartctl -l error  /dev/sdb

Sample Output

smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Error Log Version: 1
ATA Error Count: 5
    CR = Command Register [HEX]
    FR = Features Register [HEX]
    SC = Sector Count Register [HEX]
    SN = Sector Number Register [HEX]
    CL = Cylinder Low Register [HEX]
    CH = Cylinder High Register [HEX]
    DH = Device/Head Register [HEX]
    DC = Device Command Register [HEX]
    ER = Error register [HEX]
    ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 da 08 e7 e5 a5 4c 00      00:30:44.515  READ DMA EXT
  25 da 08 df e5 a5 4c 00      00:30:44.514  READ DMA EXT
  25 da 80 5f e5 a5 4c 00      00:30:44.502  READ DMA EXT
  25 da f0 5f e6 a5 4c 00      00:30:44.496  READ DMA EXT
  25 da 10 4f e6 a5 4c 00      00:30:44.383  READ DMA EXT

Wednesday, November 12, 2014

10 Open Source ERP Options

http://www.enterpriseappstoday.com/erp/10-open-source-erp-options.html


While the ERP market is dominated by software giants like SAP and Oracle, there are plenty of open source ERP options.


Take a look at the ERP market and you'll find a landscape dominated by a handful of commercial products offered by well-known enterprise software vendors such as SAP, Oracle, Microsoft and Sage.

Although there are plenty of open source ERP projects, their combined market share is negligible - perhaps as little as 1 or 2 percent. That's despite the many known advantages of open source software, such as the fact that it is usually free to download and can be customized as much as needed.

What accounts for this measly market share? While a number of factors are likely at play, one of the most important ones is that most open source projects lack marketing budgets while vendors like Oracle and SAP spend billions of dollars on sales and marketing.

That's important because ERP systems are mission-critical applications, and selecting a good one is far from easy. That means most buyers need help with the selection process. But since most open source projects have little or no money to spend on sales and marketing efforts, it is disproportionately hard for them to get shortlisted and eventually selected.

There's also the problem of expertise. Open source projects in general have been particularly successful in areas where the developers are developing for other developers; in other words when they are building IT tools and infrastructure products like operating systems and Web servers. But few open source developers are experts at business, or have the expertise to know exactly what businesses need.

One way around this problem is for projects to commercialize themselves, creating an open source core, and then building proprietary extensions to the core code to make a commercial offering that is no longer open source. As a result, some of the free ERP offerings -- while powerful -- are nowhere near as complete as the commercial products that are built on top of them.

Open Source ERP Short List

Here are some of the best open source ERP offerings available today:

ADempiere ERP Business Suite. (Java) ADempiere is a comprehensive multi-platform ERP platform that was forked from another ERP project called Compiere back in 2006. It offers a vast array of features including sales, purchasing, accounting, manufacturing management, material management and finance, as well as HR, CRM and payroll. The software is available to download from Sourceforge under the GPL.

Apache OFBiz. Multi-platform (Java) OFBiz (which stands for Open for Business) is the Apache Foundation's enterprise business package. Released under the Apache License 2.0, it is free to download from Apache. The suite includes many ERP functions including e-commerce, catalog management, promotion and pricing management, order management, warehouse management, accounting, manufacturing management, PoS and other features.

Odoo. (Python, Javascript, PostgresSQL) Odoo is the new name for an open source business suite previously known as OpenERP. The product is aimed at companies of all sizes, and is used by businesses including Danone, Canonical, Singer and the French postal service La Poste. The suite is split into a number of discrete apps or modules, including billing, accounting, manufacturing, purchasing, warehouse management and project management.

The community edition of Odoo is available to download for free, and this includes all modules - ERP ones as well as CRM, marketing and others. The hosted version is available free for two users, and thereafter costs Euros 12 per user ($15 U.S) per month for each app, including email support. A more comprehensive package that includes customization assistance and training materials is also available for Euros 111 per user ($138 U.S.) per month for each app.

xTuple. (Qt and Postgres) xTuple claims to be the world's number one open source ERP suite and has been around in one form or another since 2000. It offers a free open source edition called PostBooks which is available from Sourceforge, and is also available as a licensed product with maintenance, support and the option to use it as a service offered from the cloud.

As well as these two editions, which are aimed at small and medium sized companies, xTuple offers three further commercial editions for larger organizations - one aimed at distributors, one targeted at manufacturers and a more general enterprise edition. These are built on the same open source foundation and share the same code base.

The open source edition includes functionality for accounting, sales, CRM, purchasing, product definition, inventory and distribution, light manufacturing and the OpenRPT open source report writer. The commercial license for PostBooks costs $1,200 per user for a perpetual license, or $400 per user per year. If used as a service this costs an extra $100 per month, plus $30 per user per month.

OpenBravo ERP. (Java) OpenBravo is an open source ERP system which is available to download on Sourceforge. Aimed at small and medium sized businesses, this modular system includes finance and accounting, purchasing management, sales management, inventory management, project management, PoS, business intelligence and other modules.

OpenBravo also offers two commercial editions - a professional edition for smaller companies with up to 5 concurrent users and an enterprise edition for larger companies with substantial numbers of users.

opentaps is an integrated open source ERP and CRM suite sponsored by Open Source Strategies, Inc. and used by organizations including Toyota and Honeywell. Opentaps supports e-commerce, CRM, warehouse and inventory management, supply chain management, financial management, business intelligence and mobility integration out of the box. The name "opentaps" was originally an acronym for "Open Source Enterprise Applications Suite."
opentaps is available as free software under the GNU Affero GPL v3, and also with a commercial license that allows you to modify the source code without the obligation to make your customizations public.

The opentaps Professional Edition is offered under a commercial license with a support package provided by Open Strategies that includes updates for opentaps releases, access to opentaps support issue tracker, guaranteed response time of four hours during support hours and remote assistance via VNC and SSH for $600 per user per year.

Dolibarr. Designed for small companies and individual traders, Dolibarr is an open source business suite that includes ERP and CRM functionality. It can be installed on a local machine or accessed from a server, and is also offered as a software-as-a-service (SaaS) solution with a free trial period by Dolibarr preferred partners including DoliCloud and ATM Consulting.

The software is highly modular, and main modules include sales and purchase management, stock management, bank account management, orders management and shipping management. Additional paid-for modules are also available from the official DoliStore.

ERP5. (Python, Zope) ERP5 covers accounting, customer relationship management, trade, warehouse management, shipping, invoicing, human resource management, product design, production and project management.

ERPNext. (MySQL, Python) ERPNext is an ERP solution similar to Openbravo and Odoo, aimed at small and medium sized businesses

LedgerSMB. (PostgreSQL, Perl) LedgerSMB is a free double entry accounting and ERP software system aimed at small and medium sized businesses.

How to run a command on Remote server without login to server shell prompt?

http://www.nextstep4it.com/how-to-run-a-command-on-remote-server-without-login-to-server-shell-prompt

By using SSH command, You can run a command on remote server without login to server shell.
SSH Command Format:
# ssh remoteuser@remotehost remotecommand
Suppose I want to run ls command on remote server pk.testmail.com
parveen@Earth:~$ ssh root@pk.testmail.com ls
 The authenticity of host ' pk.testmail.com (x.x.x.x)' can't be established.
 RSA key fingerprint is 7d:74:91:ed:30:1e:86:0b:69:c9:77:0b:72:0e:ad:4e.
 Are you sure you want to continue connecting (yes/no)? yes
 Warning: Permanently added 'pk.testmail.com' (RSA) to the list of known hosts.
 root@pk.testmail.com's password:

anaconda-ks.cfg
downloads
install.log
install.log.syslog
Note : - When we run any command on remote server, by default ssh will not allocate a pseudoterminal. For using pseudoterminal we have to use -t option with ssh command as explained below.
parveen@Earth:~$ ssh -t root@ pk.testmail.com ls
 root@pk.testmail.com's password:
 anaconda-ks.cfg  downloads  install.log  install.log.syslog
 Connection to pk.testmail.com closed.
Now you can see, Command out put will be same as we run same command after login to remote server.
To run multiple commands on remote server, use semi-colon between commands as shown below:
parveen@Earth:~$ ssh -t root@ pk.testmail.com "ls ; df -h ; date ; cal"
 root@pk.testmail.com's password:
 anaconda-ks.cfg  downloads  install.log  install.log.syslog  server_invalid_mails_cleanup.sh
 Filesystem      Size  Used Avail Use% Mounted on
 /dev/vda         20G  6.9G   12G  37% /
 tmpfs           246M     0  246M   0% /dev/shm
 Mon Nov 10 00:52:12 EST 2014
 November 2014
 Su Mo Tu We Th Fr Sa
 1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
 16 17 18 19 20 21 22
 23 24 25 26 27 28 29
 30
 Connection to pk.testmail.com closed.
We can also use echo command to run a remotecommand on remoteserver.
parveen@Earth:~$ echo "ls" | ssh root@pk.testmail.com
 Pseudo-terminal will not be allocated because stdin is not a terminal.
 root@pk.testmail.com's password:
 anaconda-ks.cfg
 downloads
 install.log
 install.log.syslog
Note:- We can’t use -t option with ssh command to run remotecommand using echo command because Pseudo-terminal will not be allocated because stdin is not a terminal.
Use ssh command with tar command to move a directory of files between two machines as an alternative to scp command. Example is explained below:
parveen@Earth:~$ tar -cvf - images/test1 | ssh root@ pk.testmail.com  '(cd /tmp/; tar -xf -)'
 images/test1/
 images/test1/7
 images/test1/6
 images/test1/5
 images/test1/4
 images/test1/9
 images/test1/8
 images/test1/3
 images/test1/2
 images/test1/1
 root@pk.testmail.com's password:

Now files are uploaded on Remote server. Check files on remote server as shown below.

[root@pk tmp]# ls -l images/
 total 4
 drwxrwxr-x 2 1000 1000 4096 Nov 10 01:02 test1
 [root@pk tmp]# ls -l images/test1/
 total 0
 -rw-rw-r-- 1 1000 1000 0 Nov 10 01:02 1
 -rw-rw-r-- 1 1000 1000 0 Nov 10 01:02 2
 -rw-rw-r-- 1 1000 1000 0 Nov 10 01:02 3
 -rw-rw-r-- 1 1000 1000 0 Nov 10 01:02 4
 -rw-rw-r-- 1 1000 1000 0 Nov 10 01:02 5
 -rw-rw-r-- 1 1000 1000 0 Nov 10 01:02 6
 -rw-rw-r-- 1 1000 1000 0 Nov 10 01:02 7
 -rw-rw-r-- 1 1000 1000 0 Nov 10 01:02 8
 -rw-rw-r-- 1 1000 1000 0 Nov 10 01:02 9