Observium client setup notes

observium server on ubuntu


observium agent

wget http://x.x.x.x/apache
wget http://x.x.x.x/mysql
wget http://x.x.x.x/nginx


#setup agent
apt-get -y install xinetd wget
cd /etc/xinetd.d/
wget http://x.x.x.x/observium_agent_xinetd
cd /usr/bin/
wget http://x.x.x.x/observium_agent
chmod 775 /usr/bin/observium_agent
mkdir /usr/lib/observium_agent
mkdir /usr/lib/observium_agent/local
service xinetd restart
#monitor with mysql agent
apt-get -y install php5-cli php5-mysql
cd /usr/lib/observium_agent/local
wget http://x.x.x.x/mysql
chmod 775 mysql
echo "<?php \$mysql_user = 'observium_mon'; \$mysql_pass='xxx'; ?>" > /usr/lib/observium_agent/local/mysql.cnf

mysql -e "GRANT SUPER, REPLICATION SLAVE, PROCESS ON *.* TO 'observium_mon'@'localhost' IDENTIFIED BY 'xxx';"
apt-get -y install snmpd
cd /usr/bin/
wget http://x.x.x.x/distro
chmod 775 distro
cd /etc/snmp/
mv snmpd.conf snmpd.conf.orig
wget http://x.x.x.x/snmpd.conf
service snmpd restart

compiling cacti-spine 0.8.8d with mariadb on centos6

get the other libraries snmp, ssl, etc

yum install MariaDB-devel
ln -s /usr/lib64/mysql/libmysqlclient_r.so.16.0.0 libmysqlclient_r.so
ln -s /usr/lib64/mysql/libmysqlclient.so.16.0.0 libmysqlclient.so

then compile
if you get this error during make
common.h:143:18: error: mib.h: No such file or directory


cp /usr/include/net-snmp/library/mib.h .

How to guide to get google adwords to work with your prestashop

After googling I couldn’t find any guide to get this to work. I had to piece together bunch of posts and spent a whole night of trial and error came up with this.

In order-confirmation.tpl add to the bottom and fill out your variables from your google adwords

<!-- Google Code for Purchase Conversion Page -->
<script type="text/javascript">
{literal} /* <![CDATA[ */ {/literal}
var google_conversion_id = ENTER_YOUR_ID_HERE;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "ENTER_YOUR_LABEL_HERE";
var google_conversion_value = {$total_pay};
var google_conversion_currency = "{$currencyiso}";
var google_remarketing_only = false;
{literal}/* ]]>*/ {/literal}
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/ENTER_YOUR_ID_HERE/?value={$total_pay}&amp;currency_code={$currencyiso}&amp;label=ENTER_YOUR_LABEL_HERE&amp;guid=ON&amp;script=0"/>

in OrderConfirmationController.php add below in initContent function

        public function initContent()

                        'is_guest' => $this->context->customer->is_guest,
                        'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(),
                        'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()

$order = new Order($this->id_order);
$currency = new Currency($order->id_currency);
'total_pay' => $order->getOrdersTotalPaid(),
'currencyiso' => $currency->iso_code
                if ($this->context->customer->is_guest)

to test if this is working I used the google tag assistant chrome extension and made a bunch of orders using bankwire payment method.

Good luck….





For Chrome v40: Open chrome://flags Look for “Minimum SSL/TLS version supported.” Choose SSLv3 Click on “Relaunch now” button Open your https page again You will be redirected to a “Your connection is not private” page. If you do not worry about this security issue click on the “Advanced” link. Finally click on “Proceed to (unsafe)”. Solved.

sed tips

sed -i ‘s/fengo/dressholic/g’ * 

sed -i ‘s/Fengo/Dressholic/g’ * 

search folders for file type recurisvely and replace text in file

find . -type f -exec sed -i.bak “s/fengo/dressholic/g” {} \; 

find . -type f -exec sed -i.bak “s/Fengo/Dressholic/g” {} \; 

delete files in folders with extension

find . -name “*.bak*” -type f -delete

In Unix, how do I find a user’s UID or GID?

In Unix, how do I find a user’s UID or GID?

To find a user’s UID or GID in Unix, use the id command. To find a specific user’s UID, at the Unix prompt, enter:

  id -u username

Replace username with the appropriate user’s username. To find a user’s GID, at the Unix prompt, enter:

  id -g username

If you wish to find out all the groups a user belongs to, instead enter:

  id -G username

If you wish to see the UID and all groups associated with a user, enter id without any options, as follows:

  id username

invalid app Id: Must be a number or numeric string representing the application id. FB.getLoginStatus() called before calling FB.init().

this was my original code

(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id; js.async = true;
js.src = "//connect.facebook.net/{/literal}{$st_lb_locale}{literal}/all.js#xfbml=1;
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

I tried to add FB.init above it with app id but I get an error that FB.init was already called.

FB.init has already been called – this could indicate a problem

“From the moment you pass parameters to the js.src like #xfbml=1&appId=X, FB SDK will auto init itself and thus FB.init will try to reinit.. So in your code, you don’t have to remove the FB.init function, just make sure you don’t pass parameters in the code that loads asynchronously the JS SDK.”

So either use all.js or use the sdk.js

so change it to

(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id; js.async = true;
js.src = "//connect.facebook.net/{/literal}{$st_lb_locale}{literal}/all.js#xfbml=1&appId=<your app id>;
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));


Prestashop – Create Unique Reference ID with Product Combinations Generator

I use the prestashop amazon module and Amazon requires a unique reference number per combination. To save time modifying each reference I modified the combinations generator controller. If you have tons of attributes this will save you tons of time.

I’m pretty noob at this kind of stuff but it works. If you know a better way to do this let me know.

Thanks, zeki893

Here we go:

open AdminAttributeGeneratorController.php

Look for function addAttribute

You’ll see

foreach ($attributes as $attribute)
$price += (float)preg_replace('/[^0-9.-]/', '', str_replace(',', '.', Tools::getValue('price_impact_'.(int)$attribute)));
$weight += (float)preg_replace('/[^0-9.]/', '', str_replace(',', '.', Tools::getValue('weight_impact_'.(int)$attribute)));

I modified it into

foreach ($attributes as $attribute)
$price += (float)preg_replace('/[^0-9.-]/', '', str_replace(',', '.', Tools::getValue('price_impact_'.(int)$attribute)));
$weight += (float)preg_replace('/[^0-9.]/', '', str_replace(',', '.', Tools::getValue('weight_impact_'.(int)$attribute)));

//get the attributes name
$sqltest = 'SELECT * FROM `attribute_lang` WHERE `id_attribute` = '. $attribute .' LIMIT 0 , 1';
if ($resultstest = Db::getInstance()->ExecuteS($sqltest))
foreach ($resultstest as $rowtest)
$id_attribute_name = $rowtest[name];

//get the attributes group id to see if its color or size
$sqltest2 = 'SELECT * FROM `attribute` WHERE `id_attribute` = '. $attribute .' LIMIT 0 , 1';
if ($resultstest2 = Db::getInstance()->ExecuteS($sqltest2))
foreach ($resultstest2 as $rowtest2)
$id_attribute_colorsize = $rowtest2[id_attribute_group];

//this will determine if the attribute is a color or size
//11 is the color group id in my mysql database
if ($id_attribute_colorsize== 11) {
//12 is the size group id in my mysql database
elseif ($id_attribute_colorsize == 12) {

You will need to modify

$id_attribute_colorsize== 11 and $id_attribute_colorsize == 12

I checked mysql attribute_group table to find the attribute group ID of color and size.

right below it you’ll find

if ($this->product->id)
return array(
'id_product' => (int)$this->product->id,
'price' => (float)$price,
'weight' => (float)$weight,
'ecotax' => 0,
'quantity' => (int)Tools::getValue('quantity'),
'reference' => pSQL($_POST['reference']),
'default_on' => 0,
'available_date' => '0000-00-00'


‘reference’ => pSQL($_POST[‘reference’]),


‘reference’ => pSQL($_POST[‘reference’]).$id_attribute_color.’_’.$id_attribute_size,

You can re-order color or size anyway you’d like.

Your results will look like this.
products combinations generator
full modified function:

protected function addAttribute($attributes, $price = 0, $weight = 0)
    foreach ($attributes as $attribute)
      $price += (float)preg_replace('/[^0-9.-]/', '', str_replace(',', '.', Tools::getValue('price_impact_'.(int)$attribute)));
      $weight += (float)preg_replace('/[^0-9.]/', '', str_replace(',', '.', Tools::getValue('weight_impact_'.(int)$attribute)));
      //get attribute name
      $sqltest = 'SELECT * FROM  `attribute_lang` WHERE  `id_attribute` = '. $attribute .' LIMIT 0 , 1';
      if ($resultstest = Db::getInstance()->ExecuteS($sqltest))
    			foreach ($resultstest as $rowtest)
        			$id_attribute_name = $rowtest[name];
        		//echo $id_attribute_name;
      //get attribute color or size
      $sqltest2 = 'SELECT * FROM  `attribute` WHERE  `id_attribute` = '. $attribute .' LIMIT 0 , 1';
      if ($resultstest2 = Db::getInstance()->ExecuteS($sqltest2))
    			foreach ($resultstest2 as $rowtest2)
        			$id_attribute_colorsize = $rowtest2[id_attribute_group];
        	if ($id_attribute_colorsize== 11) {

        	} elseif ($id_attribute_colorsize == 12) {

    if ($this->product->id)
      return array(
        'id_product' => (int)$this->product->id,
        'price' => (float)$price,
        'weight' => (float)$weight,
        'ecotax' => 0,
        'quantity' => (int)Tools::getValue('quantity'),
        'reference' => pSQL($_POST['reference']).$id_attribute_color.'_'.$id_attribute_size,
        'default_on' => 0,
        'available_date' => '0000-00-00'
    return array();

This can also be done via overrides so you don’t modify the core file.

Change file and folder permissions

  1. find . -type f -exec chmod 644 {} ;
  2. find . -type d -exec chmod 755 {} ;

    below works for ubuntu
    To change permission of only files under a specified directory.
    [email protected]:/home/user$ sudo find /path/to/someDirectory -type f -print0 | xargs -0 sudo chmod 644

  3. [email protected]:/home/user$ ls -l
  4. total 3
  5. -rw-r–r–  1 user user 0 Nov 19 20:13 file1
  6. drwxrwxrwx  2 user user 4096 Nov 19 20:13 folder
  7. -rw-r–r–  1 user user 0 Nov 19 20:13 file2
    To change permission of only directories under a specified directory (including that directory):
    [email protected]:/home/user$ sudo find /path/to/someDirectory -type d -print0 | xargs -0 sudo chmod 755
  8. [email protected]:/home/user$ ls -l
  9. total 3
  10. -rw-r–r–  1 user user 0 Nov 19 20:13 file1
  11. drwxr-xr-x  2 user user 4096 Nov 19 20:13 folder
  12. -rw-r–r–  1 user user 0 Nov 19 20:13 file2

passwd: Authentication token manipulation error


[[email protected] ~]# passwd
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: Authentication token manipulation error


[[email protected] ~]# /usr/sbin/useradd aa useradd: unable to open password file
[[email protected] ~]# chattr -i /etc/passwd
[[email protected] ~]# /usr/sbin/useradd aa
useradd: cannot open shadow password file
[[email protected] ~]# lsattr /etc/passwd ————– /etc/passwd
[[email protected] ~]# lsattr /etc/shadow —-i——— /etc/shadow
[[email protected] ~]# chattr -i /etc/shadow
[[email protected] ~]# passwd
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[[email protected] ~]

Latest cpanel 11.48 broke cphulkd

The system failed to add an IP address to cphulkd hosts because the “cphulkd.ip_lists” table may be corrupted and returned the following error: DBD::mysql::db do failed: Table ‘cphulkd.ip_lists’ doesn’t exist.


[email protected] [/var/cpanel]# /usr/local/cpanel/bin/hulkdsetup
hulkdsetup: synchronizing database schema

# was datetime DEFAULT NULL
# was datetime DEFAULT NULL
# was datetime DEFAULT NULL
# was datetime DEFAULT NULL
ALTER TABLE report CHANGE COLUMN logintime logintime timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’
# was datetime DEFAULT NULL
CREATE TABLE ip_lists (
CREATE TABLE login_track (
USER char(128) NOT NULL,
LOGINTIME timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
EXPTIME timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
NOTES text,

Radius login with Ubuntu

sudo apt-get install libpam-radius-auth


$ sudo vim /etc/pam_radius_auth.conf


other-server    other-secret       3

change to

192.168.x.x secretkey 3

Edit your /etc/pam.d/sshd file and add the line:

auth       sufficient  pam_radius_auth.so

Just above:

# Standard Un*x authentication.
@include common-auth

had to update firewall config and configure radius to accept auths from this IP

using this to upload screenshots for evernote skitch

also installed nginx

modified default

        root /home;

        server_name vpls.in;

location ~ ^/(.+?)(/.*)?$ {
alias /home/$1/$2;
index index.html index.htm;
autoindex off;
expires 365d;

location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 30d;

also configured gzip in nginx.conf

useradd -m zeki893

nginx error connect to php5-fpm.sock failed (13: Permission denied)

PHP fixed a security bug where o had rw permission to the socket file.

  1. Open /etc/php5/fpm/pool.d/www.conf
  2. Uncomment all permission lines, like:
    listen.owner = www-data
    listen.group = www-data
    listen.mode = 0660
  3. Restart fpm – sudo service php5-fpm restart

Note: if your webserver runs as as user other than www-data, you will need to update the www.conf file accordingly

cpanel – change pure-ftpd port


1) Edit /etc/pure-ftpd.conf and look for the following line:


Where is a publically routable IP.  The default example,, will cause the socket to bind locally but then this connection won’t serve externally. is the new port you wish to put the service on.

2) If necessary, add the new FTP port to your server’s firewall

3) Edit /etc/chkserv.d/ftpd and change the port, which is the first comma-separated entry to the right of ‘=’ on the line in the file, to match the port you put the service on.


/etc/init.d/pure-ftpd restart
/etc/init.d/cpanel restart (restarts tailwatchd/chkservd)

How to Setup Apache2 (HTTPD) with FastCGI and PHP on CentOS/RHEL 6/5


yum install mod_fastcgi
Loaded plugins: fastestmirror, replace
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.psychz.net
* epel: mirror.prgmr.com
* extras: mirrors.xmission.com
* rpmforge: mirror.webnx.com
* updates: mirrors.easynews.com
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package mod_fastcgi.x86_64 0:2.4.6-2.el5.rf will be installed
--> Finished Dependency Resolution

Dependencies Resolved

Package Arch Version Repository Size
mod_fastcgi x86_64 2.4.6-2.el5.rf rpmforge 133 k

Transaction Summary
Install 1 Package(s)

Total download size: 133 k
Installed size: 364 k
Is this ok [y/N]: y
Downloading Packages:
mod_fastcgi-2.4.6-2.el5.rf.x86_64.rpm | 133 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mod_fastcgi-2.4.6-2.el5.rf.x86_64 1/1
# For example:
Verifying : mod_fastcgi-2.4.6-2.el5.rf.x86_64 1/1

mod_fastcgi.x86_64 0:2.4.6-2.el5.rf


vi /var/www/cgi-bin/php.fcgi

chmod +x php.fcgi; chown apache.apache php.fcgi

export PHPRC
exec /usr/bin/php-cgi
vi /etc/httpd/conf.d/cacti.conf
 Options +Indexes FollowSymLinks +ExecCGI
 AddHandler php5-fastcgi .php
 Action php5-fastcgi /cgi-bin/php.fastcgi

Restart apache

check phpinfo

Server API CGI/FastCGI



mod_fcgid: can’t apply process slot for /usr/local/cpanel/cgi-sys/php5

[Fri Jan 30 10:47:40 2015] [error] mod_hostinglimits:Error on LVE enter: LVE(508) HANDLER(fcgid-script) HOSTNAME(lovetheclassic.com) URL(/index.php) TID(714206) errno (7) Read more: http://e.cloudlinux.com/MHL-E2BIG

[Fri Jan 30 10:48:19 2015] [warn] [client] mod_fcgid: can’t apply process slot for /usr/local/cpanel/cgi-sys/php5

  • Also, make sure you monitor apache error logs. If you see “can’t apply process slot for error” — it means you are hitting FcgidMaxProcesses



Updating servers cuz of glibc vulnerability

Ghost is a vulnerability in glibc that attackers can use against only a handful of applications right now to remotely run executable code and gain control of a Linux server. The vulnerability is a heap-based buffer overflow and affects all Linux systems, according to experts, and has been present in the glibc code since 2000. – See more at: https://threatpost.com/php-applications-wordpress-subject-to-ghost-glibc-vulnerability/110755#sthash.PJ3vrnvp.dpuf

Check if your vulnerable http://www.cyberciti.biz/faq/cve-2015-0235-ghost-glibc-buffer-overflow-linux-test-program/

Download bash script to check for vulnerability GHOST-test.sh

GIMP may be acceptable for casual doodler or cropping photos, but …

No doubt that I would agree with the parent 100%. GIMP may be acceptable for casual doodler or cropping photos, but it ultimately a complete waste of time for any professional accustomed to a plethora of serious tools and a myriad of features used daily to make a living. We don’t even have to discuss its’ intolerable user interface because GIMP’s graphic capabilities are not even in the same ballpark as Photoshop.

However, one may be able replace some of the other software depending on how you used it. The original poster framed the scenario as tools for the marketing department to use, which clearly lowers the bar in terms of expectations as to what level of competency will be applied. Marketers are not designers, so it would appear as though if Software X does a reasonable job approximating most tasks of Adobe Y, then one can adopt it.

Photoshop – You’re unlikely to replace that one. Although, someone else mentioned Pixel [kanzelsberger.com] which could possibly cut the mustard depending on your needs. Otherwise, there really is nothing to compare to Photoshop.

Illustrator – Definitely have a strong look at Inkscape [inkscape.org]. I’ve toyed with it for 2 or 3 years to keep tabs on its’ development, after being fairly impressed during my first run through. These days it has continued to advance and I’d suggest it’s ready for the professional world. You can create substantially complex pieces with Inkscape which will probably far out-pace the ability of your Marketing department to bother learning in the first place. While it might be missing a pet feature or two, the bottomline is that Inkscape is ready to be taken seriously as a replacement for Illustrator (and, previously, FreeHand).

InDesign – Professionals already use Scribus [scribus.net] to handle multipage full color layouts sent directly to commercial print houses, so it’s gotta be worth your time to look at. CMYK separation, PDF generation,and much of the toolsets you’d expect to see in Quark or InDesign; certainly more than enough power for your Marketing department.

Acrobat Pro – If you’re heavily using features like annotation, collaboration, form creation, et cetera, then you probably won’t be replacing Acrobat Professional. Nothing can touch it. However, if all you need is to be able to allow your Marketing droids to generate PDFs from documents they create in other software, then you can slap PDFCreator [pdfforge.org] on their little Windows boxen. Remember that OpenOffice already has the ability to turn any of their normal documents and spreadsheets into a PDF at a click of a button. Surely, you’ve dumped MS Office by now.

Dreamweaver – This is a tough one because you should probably rethink your environment to realize you most likely don’t really want Dreamweaver to be used. Unless you’re just using Slashdot to conveniently survey the geek mindshare, the odds are that WYSIWYG is an old paradigm no longer needed by most scenarios. What you probably want is some kind of content management engine which your key tech person(s) can administer such that your Marketing department can monkey with the website(s). One engine could be adapted to various websites, if you proposed such a need. If I were to suppose someone was trolling Slashdot, then I would mention Quanta Plus [kdewebdev.org] before realizing Marketing droids would be helplessly confined to Windows and thus I’d point to Nvu [nvu.com] as your capable hero.

But, really, if an evaluation of your technical needs leads you back to WYSIWYG, then you’ve made a logical error somewhere. The days for that hobbled solution are definitely over.

There you have it! Free and open source software is up to the challenge is most regards. Where there are shortcomings, there are adept proprietary solutions for far, far less than the onerous cost of Adobe

Photoshop -> Gimp [gimp.org]
Illustrator -> Inkscape [inkscape.org]
InDesign -> Scribus [scribus.net]
Web Design -> Kompozer [kompozer.net], which is a bugfix release of Nvu [nvu.com] (there’s actually a lot of these, I’ve also heard Microsoft Visual Web Dev Express [microsoft.com], which has a lot of praise from various people)
At least for mac users, there are quite a few very well designed and maintained products that are shareware and rival Adobe’s offerings in both features and pizazz.

RapidWeaver [realmacsoftware.com] is an industrial-strength alternative to Dreamweaver which includes an SDK, full drag-n-drop designing interface, coding panel, Flash integration, and site maintenance. Currently it’s $49.

Coda [panic.com] is the newcomer on the block, built by one of the best Mac shareware coding companies. As with the others, it allows for drag-n-drop designing and fully supports XHTML. Panic Software’s tagline “shockingly good Mac software” is evident here cause they integrate the features of Transmit (their excellent FTP utility) including site/filepath synchronization, drag-n-drop uploading from the Dock… Coda also includes a console that’s integrated into the app window that allows for split terminal shells for SSH and other functions. Coda includes a GUI CSS editor and comprehensive HTML programmer’s guide in the application itself. $79.

TextMate [macromates.com] is the Mac’s premiere enterprise-level, yet shareware price text editor that does… pretty much anything. It can handle just about as many language bundles as jEdit but is purely Mac. It integrates well with Transmit, the shell, Subversion, and has a fully customizable code snippet library for full programmer control. I can’t even begin to summarize all the features that sets this editor apart from the others, but it easily shames Dreamweaver’s code window. Just watch the screencasts on the website. It costs 39.

CSSEdit [macrabbit.com] by MacRabbit is a GUI-powered CSS editor which has a snooping mode called X-Ray that can analyze a website’s design similar to Firefox’s 3rd party Web Developer addon, except with style, polish, and features that you’ve come to expect from Mac applications. It includes a CSS “builder” workflow that allows you to use some natural language and object-oriented programming (in the most basic sense) to build CSS effects. $29.95

There are many others including Apple’s own iWeb [apple.com] (which is included with every new Macintosh, is VERY easy to use, and puts out bloated-yet XHTML compliant code) and BBEdit [barebones.com] by Bare Bones Software which is very comparable to TextMate in many ways.


Can’t resolve *.local domain on VPN Mac Yosemite

After running

sudo discoveryutil mdnsactivedirectory yes

in the terminal we’re able to resolve .local FQDNs again. This gets it to use regular (unicast) DNS for .local domains rather than just using multicast DNS (mDNS, aka Bonjour) to look-up .local addresses.

Place the following file in /Library/LaunchDaemons: https://gist.github.com/CodingMinds/509bd12a7c7e22f0cfdd


network speedtest bench.sh



cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo )
cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo )
freq=$( awk -F: ' /cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo )
tram=$( free -m | awk 'NR==2 {print $2}' )
swap=$( free -m | awk 'NR==4 {print $2}' )
up=$(uptime|awk '{ $1=$2=$(NF-6)=$(NF-5)=$(NF-4)=$(NF-3)=$(NF-2)=$(NF-1)=$NF=""; print }')

echo "CPU model : $cname"
echo "Number of cores : $cores"
echo "CPU frequency : $freq MHz"
echo "Total amount of ram : $tram MB"
echo "Total amount of swap : $swap MB"
echo "System uptime : $up"

cachefly=$( wget -O /dev/null http://cachefly.cachefly.net/100mb.test 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from CacheFly: $cachefly "
coloatatl=$( wget -O /dev/null http://speed.atl.coloat.com/100mb.test 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Coloat, Atlanta GA: $coloatatl "
sldltx=$( wget -O /dev/null http://speedtest.dal05.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Dallas, TX: $sldltx "
linodejp=$( wget -O /dev/null http://speedtest.tokyo.linode.com/100MB-tokyo.bin 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Linode, Tokyo, JP: $linodejp "
i3d=$( wget -O /dev/null http://mirror.i3d.net/100mb.bin 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from i3d.net, Rotterdam, NL: $i3d"

#linodeuk=$( wget -O /dev/null http://speedtest.london.linode.com/100MB-london.bin 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
#echo "Download speed from Linode, London, UK: $linodeuk "
leaseweb=$( wget -O /dev/null http://mirror.leaseweb.com/speedtest/100mb.bin 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Leaseweb, Haarlem, NL: $leaseweb "
slsg=$( wget -O /dev/null http://speedtest.sng01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Singapore: $slsg "
slwa=$( wget -O /dev/null http://speedtest.sea01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Seattle, WA: $slwa "
slsjc=$( wget -O /dev/null http://speedtest.sjc01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, San Jose, CA: $slsjc "
slwdc=$( wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Washington, DC: $slwdc "
io=$( ( dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync && rm -f test_$$ ) 2>&1 | awk -F, '{io=$NF} END { print io}' )
echo "I/O speed : $io"

How to Start vSAN Observer

Remote desktop to vcenter server

Open command prompt and run

C:\Program Files\VMware\Infrastructure\VirtualCenter Server\support\rvc\rvc.bat

Enter password

Enter in prompt ->

cd localhost/<Datacenter>
cd computers/<Cluster name>
vsan.observer --run-webserver --force --no-https ./

Note: Type ‘ls’ to see listing and you can also use tab for autocomplete datacenter and cluster names

Open in browser http://localhost:8010/