vitalpointz logo

User Manual – CLI Guide

 

vitalpointz IOT Core Lite v 1.0

 

Introduction

 

vitalpointz is a comprehensive IoT platform and associated tools and utilities provider. This document provides list and description of CLI commands present on IoT Core Lite edition of the software. Presently, the vitalpointz IoT Core Lite Software is made available on Digital Ocean’s Marketplace as a 1-click application. The Software can be consumed by spinning up a ‘droplet’ from Digital Ocean’s Marketplace. The Software comes bundled in the droplet however needs to be installed manually to install and configure the same.

 

The vitalpointz IoT Core/Core Lite software implements limited CLI in order to do basic management activities as shown below

 

  1. Install/re-install and provision vitalpointz IOT Core/Core Lite
  2. Monitor the resource utilization
  3. Backup /Restore the configuration and device information
  4. Basic networking tools such as ping, traceroute etc

 

Note: The Custom CLI is designed to restrict the root access to the droplet that is installed with vitalpointz IoT Core/Core Lite. The end user cannot install any other software on the droplet.

 

Accessing CLI

 

When a vitalpointz IOT Core Lite is created under DigitalOcean’s Marketplace, the droplet is assigned with a public IP by DigitalOcean. By default. CLI is accessible over SSH using the SSH Key provided while creating the droplet. In case the SSH key was not provided during the creation time, the root password is sent to the user by email by DigitalOcean. vitalpointz custom CLI will be shown in place of regular bash shell when the droplet is accessed over SSH.

 

# ssh -i <mydroplet.key> root@<PublicIP of droplet>

 

********************************************************
*     vitalpointz IOT CORE/IOT CORE LITE CLI                              *
*                                                                                                            *
*            © 2019, vitalpointz,Inc                                                           *
*            info@vitalpointz.net                                                               *
*                                                                                                            *
*      WARNING: Authorised Access Only                                          *
********************************************************
        
Welcome root. It is Wed May 22 04:09:42 UTC 2019
vitalpointz IOT Core >

 

 

Pressing “?” at the CLI prompt shows the list of available commands and brief description of what the command does.

 

Pressing <TAB> or <SPACE> after typing few characters completes the command.

 

For installation and standing up the Platform, please refer to Getting Started with Digital Ocean document.

 

vitalpointz IOT Core >

backup            Backup vitalpointz IOT Core/IOT Core Lite Platform
clock             some utility commands for time related details
date              Show current date set on the system
df                Show available disk usage details
docker            docker commands
exit              Exit this CLI session
free              Show available free memory details
help              Display an overview of the CLI syntax
history           Display the current session's command line history
home              Return to the default vesp mode
ifconfig          ifconfig interfacename
install           Install or Reinstall vitalpointz IOT Core/IOT Core Lite Platform
mpstat            Show CPU usage details
nslookup          query Internet name server
ping              Ping
restore           Install vitalpointz IOT Core/IOT Core Lite Platform from stored backup
traceroute        TraceRoute
uname             Show OS details
uptime            Show system uptime
who               Show details of logged in sessions

vitalpointz IOT Core >

 

 

Commands

1. Command: backup

       Description: This command backs up the data in to vitalpointz managed IoT service Server. Each customer instance is allowed one copy of backup in the Server. When this command is invoked, following data gets backed up – (a) Device certificates and identities (b) User identities (c) Flow file of hosted NodeRED service (d) Rules (e) Out Port configurations. The data to be backed up is organized into archive and encrypted using passphrase entered.

 

     Note: It is recommended that the user periodically run this command to store the last working state of their IoT Core /IoT Core Lite.

 

The archive data as mentioned above is encrypted using the ‘passphrase’ provided here. Same passphrase must be used while restoring the data.

 

        Caution: vitalpointz does not store the passphrase. In other words, if the passphrase is lost, then backup data is useless. Even vitalpointz support engineers cannot recover the data. Caution must be exercised in handling the passphrase.

 

vitalpointz IOT Core > backup

Starting Vitalpointz IOT Core Backup

Organization Name : "xxxxx"

Backup data requires a passphrase to secure data.
NOTE: Organization name and passphrase is mandatory to restore from backup.
Enter a passphrase(min 6 char): <Enter a  Passphrase>

Reenter passphrase: <ReEnter Passphrase>

 - Backup database
 - Backup device certificates
 - Backup node-red flows
 - Backup nrps data
 - Backup config files
 - Taring backup content
 - Securing backup content
 - Uploading to OPS server
 - backup completed succesfully. Run restore command to restore to this state.

vitalpointz IOT Core >

 

2.1 Command: clock

        Description: allows user to set time and timezone of the droplet. Use ‘set’ parameter to set the time.

 

vitalpointz IOT Core > clock set 05:43:59 22 May 2019
SET-TIME time:05:43:59 day:22 month:5 year:2019
vitalpointz IOT Core >

 

2.2 Command: clock

Description: In order to set new timezone, first run this command with ‘show_timezone’ parameter. This shows the list of all timezone strings available in the droplet.

 

vitalpointz IOT Core > clock
set           show-timezone timezone     
vitalpointz IOT Core > clock show-timezone
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura

 

2.3 Command: clock

description: Below usage shows how to set the timezone. Run the command with the appropriate timezone string copied from above command.

 

vitalpointz IOT Core > clock timezone Asia/Kolkata

 

3. Command: date

Description: shows the system time.

 

vitalpointz IOT Core > date
Wed May 22 05:40:39 UTC 2019
vitalpointz IOT Core >

 

4. Command: df

Description: shows the disk usage of the droplet.

 

vitalpointz IOT Core > df
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        80G   31G   50G  38% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G   28M  1.9G   2% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
overlay          80G   31G   50G  38% /var/lib/docker/overlay2/6a69a16ecb633c0e9df0fd93e61f0e48c97b140ac70582315457945809b1f58b/merged
shm              64M     0   64M   0% /var/lib/docker/containers/613f0b045739d87f6491d3f70286d6ac6c25615fa8d200aeac221e519d5872c4/mounts/shm
overlay          80G   31G   50G  38% /var/lib/docker/overlay2/87108f3706285ccf6dfb14335ad6b8727cd6d1e6b6df313f56bd03957aaf3e92/merged
shm              64M     0   64M   0% /var/lib/docker/containers/3e4d1ece68eb9971992af5c66666bd2268cd47c6a681ac173a591327b6e526da/mounts/shm
overlay          80G   31G   50G  38% /var/lib/docker/overlay2/c021e9fef66180308f67310ad20f0fa6982b3f6a819255a963225b94aa384a09/merged
shm              64M     0   64M   0% /var/lib/docker/containers/ce5e734180296d25579d672516664132c5bc9db1f18ff1daca19e43874d25211/mounts/shm
overlay          80G   31G   50G  38% /var/lib/docker/overlay2/cc7f351cb5b0100aa365e377e5d11377d63de90379b9aac6c1a54d4495aa79a8/merged
shm              64M     0   64M   0% /var/lib/docker/containers/65caed33d63a8318af7e160ebc7a86171ba28d983713a3b418aa17172e31023e/mounts/shm
overlay          80G   31G   50G  38% /var/lib/docker/overlay2/f13209e32e2f0810b7d8b785ed0ccf7d20b6f9c740a52c59f50ce98e59a74079/merged

 

5. Command: docker

Description: This command runs docker command with one additional parameter as argument. For e.g., docker ps

 

vitalpointz IOT Core > docker ps
CONTAINER ID        IMAGE                                                      COMMAND                  CREATED                  STATUS                  PORTS                                                                                                      NAMES
b7d5a1e89a97        bitnami/redis:latest                                       "/entrypoint.sh /run…"   Less than a second ago   Up Less than a second   6379/tcp                                                                                                   redis
4f500146e857        grafana/promtail:latest                                    "/usr/bin/promtail -…"   25 hours ago             Up 25 hours                                                                                                                        promtail
cb5218c5d526        creg.ops.vitalpointz.com/iotcore/ui-lite:latest            "sh start.sh"            25 hours ago             Up 25 hours             3000/tcp                                                                                                   ui
ab31a0d6731e        v2tec/watchtower                                           "/watchtower --clean…"   25 hours ago             Up 25 hours                                                                                                                        watchtower
920b9c36ca61        creg.ops.vitalpointz.com/iotcore/influxdb                  "sh start.sh"            25 hours ago             Up 25 hours             8086/tcp, 25826/udp                                                                                        influxdb
167eb42fae1e        creg.ops.vitalpointz.com/iotcore/smsnotify                 "sh start.sh"            25 hours ago             Up 25 hours                                                                                                                        smsnotify
0f97c2d7ac8d        creg.ops.vitalpointz.com/iotcore/outport                   "sh start.sh"            25 hours ago             Up 25 hours                                                                                                                        outport
45dcace72da7        creg.ops.vitalpointz.com/iotcore/vdevice                   "sh start.sh"            25 hours ago             Up 25 hours             5041/tcp                                                                                                   vdevice
10e907f98c92        creg.ops.vitalpointz.com/iotcore/ustdapi                   "sh start.sh"            25 hours ago             Up 25 hours             1650/tcp                                                                                                   ustdapi
30e3f1463efa        creg.ops.vitalpointz.com/iotcore/us-mqtt-broker-external   "/docker-entrypoint.…"   25 hours ago             Up 25 hours             1883/tcp, 2002-2003/tcp                                                                                    us-mqtt-broker-external
0ecd6e90ffca        creg.ops.vitalpointz.com/iotcore/tdapi                     "sh start.sh"            25 hours ago             Up 25 hours             1648/tcp                                                                                                   tdapi
d68bba21ce6c        creg.ops.vitalpointz.com/iotcore/tapi                      "sh start.sh"            25 hours ago             Up 25 hours             1648/tcp                                                                                                   tapi
d260825b19c6        creg.ops.vitalpointz.com/iotcore/state-machine             "sh start.sh"            25 hours ago             Up 25 hours                                                                                                                        state-machine
….

….

….

 

 6. Command: exit

Description: Quits the CLI program.

Caution: When this command is executed, all currently logged in sessions will be exited.

 

7. Command: free

Description: This command shows the memory utilization of the droplet.

 

vitalpointz IOT Core > free
              total        used        free      shared  buff/cache   available
Mem:           3789        3437          86          27         265          46
Swap:             0           0           0
vitalpointz IOT Core >

 

8. Command: help

Description: This command shows the detailed help on the CLI usage.

 

vitalpointz IOT Core > help

CONTEXT SENSITIVE HELP
[?] - Display context sensitive help. This is either a list of possible
      command completions with summaries, or the full syntax of the
      current command. A subsequent repeat of this key, when a command
      has been resolved, will display a detailed reference.

AUTO-COMPLETION
The following keys both perform auto-completion for the current command line.
If the command prefix is not unique then the bell will ring and a subsequent
repeat of the key will display possible completions.

[enter] - Auto-completes, syntax-checks then executes a command. If there is
          a syntax error then offending part of the command line will be
          highlighted and explained.

[space] - Auto-completes, or if the command is already resolved inserts a space.

MOVEMENT KEYS
[CTRL-A] - Move to the start of the line
[CTRL-E] - Move to the end of the line.
[up]     - Move to the previous command line held in history.
[down]   - Move to the next command line held in history.
[left]   - Move the insertion point left one character.
[right]  - Move the insertion point right one character.

DELETION KEYS
[CTRL-C]    - Delete and abort the current line
[CTRL-D]    - Delete the character to the right on the insertion point.
[CTRL-K]    - Delete all the characters to the right of the insertion point.
[CTRL-U]    - Delete the whole line.
[backspace] - Delete the character to the left of the insertion point.

ESCAPE SEQUENCES
!!  - Subsitute the the last command line.
!N  - Substitute the Nth command line (absolute as per 'history' command)
!-N - Substitute the command line entered N lines before (relative)

 

9. Command: History

Description: This shows history of previously executed commands.

 

vitalpointz IOT Core > history
    1  install
    2  history
vitalpointz IOT Core > 

 

10. Command: Home

Description: This command returns to default CLI level.

 

11. Command: ifconfig

Usage: ifconfig <interface name>

Description: This command shows interface details of the given interface name

 

vitalpointz IOT Core > ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet xx.yy.zz.aa  netmask 255.255.240.0  broadcast xx.yy.zz.255
        inet6 fe80::2837:xxxx:xxxx:yyyy  prefixlen 64  scopeid 0x20<link>
        ether 2a:xx:xx:xx:xx:xx  txqueuelen 1000  (Ethernet)
        RX packets 830704  bytes 643057835 (613.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 806749  bytes 720756423 (687.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

12. Command: install

Description: This command installs freshly or Reinstalls IoT Core/ Core Lite version of the software, registers with vitalpointz managed IOT Service Server, Configures the public DNS, Provisions letsencrypt certificates and installs them on the droplet. Follow thru the interactive script to complete the installation process.  

 

vitalpointz IOT Core > install
 ____                             ___    _____    ____               
/ ___|  ___  ___ _   _ _ __ ___  |_ _|__|_   _|  / ___|___  _ __ ___
\___ \ / _ \/ __| | | | '__/ _ \  | |/ _ \| |   | |   / _ \| '__/ _ \
 ___) |  __/ (__| |_| | | |  __/  | | (_) | |   | |__| (_) | | |  __/
|____/ \___|\___|\__,_|_|  \___| |___\___/|_|    \____\___/|_|  \___|
                                                                     
 _     _ _       
| |   (_) |_ ___
| |   | | __/ _ \
| |___| | ||  __/
|_____|_|\__\___|
                 
        by vitalpointz, Inc

****************************************************************************************************************

* Please read the following end user license agreement (EULA). You must accept before continuing with installation                                  *

****************************************************************************************************************


Press Enter to continue.....
End User License Agreement for vitalpointz IoT Core / vitalpointz IoT Core Lite
….

….

….

….


Do you accept the EULA? [yes/no]: yes



Enter your organization name(max 128 character): xyxyxy
*******************************************************************************************************************************************************************************************************
* Enter Organization name in short form.                                                                                                                                                                             *
* Short Organization name can be maximum of 16 alphanumeric characters, No space or special characters allowed.                                                                                                        *
* Your Secure IOT Core will be accessible using                                                                                                                                                       *
* <orgname.vitalpointz.com>                                                                                                                                                                           *
* For e.g., if the organization name entered is acmecorp, the URL will be                                                                                                                             *
* acmecorp.vitalpointz.com                                                                                                                                                                            *
*******************************************************************************************************************************************************************************************************

Enter your organization name(Max 16 character and no special character): xxxx
Checking organization name availability...done
Enter your name: <your name>
*******************************************************************************************************************************************************************************************************
* Enter valid email id. We will send access details over the email.                                                                                                                                  *
*******************************************************************************************************************************************************************************************************

Enter your email id: <your email id>
Enter  description[optional]:
Enter country[optional]:
Enter city[optional]:
Enter contact number with country code[optional]:
*******************************************************************************************************************************************************************************************************
* We seek permission to collect application performance information remotely.                                                                                                                          *
* We need these information to optimize our application, improve performance and                                                                                                                      *
* support you better.                                                                                                                                                                                 *
* We do NOT collect nor share your IOT device data, sensor data and your personal information.                                                                                                        *
*******************************************************************************************************************************************************************************************************

Do you agree to share your application performance data [yes/no]-default[yes]:


*******************************************************************************************************************************************************************************************************
* Please review the information provided by you.                                                                                                                                                      *
*******************************************************************************************************************************************************************************************************

{
  "Description": "",
  "access_url": "https://<org>.vitalpointz.com",
  "city": "",
  "contact_no": "",
  "country": "",
  "full_orginazation_name": <org>,
  "host_name": <host name entered>,
  "ip": <drop let IP>
  "monitoring": "yes",
  "organization": <Org name>,
  "tenantRootEmail": <email id>,
  "tenantRootName": <your name>
}

All looks good? Would you like to proceed with the installation [yes/no]-default[yes]:
Setting up Environment...done
Begin the instance registration....

Registering instance with operation server...done

Bringing up Monitoring Services

Creating nodeexporter ... done

Creating cadvisor ... done

….

….

….

 

 ...done

****************************************************************************************************************

* Welcome to Secure IOT Core/Platform by vitalpointz,inc.                                                                                                                              *

* This virtual machine is installed with software distribution of IOT Core / Platform, created by vitalpointz Inc                                             *

* Hereby, the license to use this software is granted to <Org Name>                                                                                                                 *

* The software can be accessed using https://<orgName>.vitalpointz.con with credentials shared in your registered email                            *

* By using this software you agree to the terms and conditions available under the ‘Terms of use’ menu item in the web app specified in.   *

* above URL.                                                                                                                                                                                                       *

* For any clarifications reach out to us via email using support@vitalpointz.net                                                                                               *

****************************************************************************************************************

 

13. Command: mpstat

Description: this command shows the CPU usage.

 

vitalpointz IOT Core > mpstat
Linux 3.10.0-957.12.2.el7.x86_64 (<host name>)     05/23/2019     _x86_64_    (2 CPU)

07:50:58 AM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
07:50:58 AM  all   13.71    0.00    5.96    1.43    0.00    0.09    0.08    0.00    0.00   78.73
vitalpointz IOT Core >

 

14. Command: nslookup

Description: This command resolves the URL into IP Address

 

vitalpointz IOT Core > nslookup google.com
Server:        67.207.67.3
Address:    67.207.67.3#53

Non-authoritative answer:
Name:    google.com
Address: 172.217.163.78

 

15. Command: ping

Description: This command helps the user to check the reachability from the droplet to given IP.

 

vitalpointz IOT Core > ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=8.26 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=7.83 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=56 time=7.84 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=56 time=7.86 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=56 time=7.88 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=56 time=7.82 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=56 time=7.89 ms
^C
--- 8.8.8.8 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6010ms
rtt min/avg/max/mdev = 7.827/7.915/8.265/0.159 ms
vitalpointz IOT Core >

 

16. Command: restore

Description: This command restores the IOT Core/Core Lite software from the previously back-ed up data. User can restore their old instance of IoT Core/IoT Core Lite on a new droplet using this command.

‘backup’ and ‘restore’ commands can be used as disaster recovery strategy.

 

vitalpointz IOT Core > restore
Warning : Restore will overwrite the current setup from backup. Allow yes/no(default) : yes

Starting Vitalpointz IOT Core Restore

Enter your Orginization : <org Name>
Enter Passphrase :
Enable Monitoring yes(default)/no : yes

 - Authenticating with OPS server

- Downloading backup file
 - Decrypting backup file
 - Unpacking backup file
 - Cleaning old containers
 - Updating containers [ this usually takes a while, please wait... ]

 

17. Command: traceroute

Description: The command runs trace route command to given URL.

 

vitalpointz IOT Core > traceroute google.com
 1?: [LOCALHOST]                                         pmtu 1500
 1:  206.189.128.254                                       0.912ms
 1:  206.189.128.254                                       0.582ms
 2:  138.197.249.0                                         0.668ms
 3:  202.56.198.57                                        61.327ms
 4:  182.79.176.201                                       56.335ms asymm  7
 5:  no reply
 6:  no reply
 7:  no reply
 8:  no reply
 9:  no reply
10:  no reply
11:  no reply
12:  no reply
^Cvitalpointz IOT Core >

 

18. Command: uname

Description: This command provides the Kernel version information of the droplet.

 

vitalpointz IOT Core > uname
Linux xx-xxxxx-xxxx-xxxx-12 3.10.0-957.12.2.el7.x86_64 #1 SMP Tue May 14 21:24:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

 

19. Command: uptime

Description: This command provides uptime of the droplet.

 

vitalpointz IOT Core > uptime
 07:43:46 up 17 min,  1 user,  load average: 0.27, 0.78, 0.76

 

20. Command: who

Description: This command shows the list of currently logged-in sessions.

 

vitalpointz IOT Core > who
 07:43:48 up 17 min,  1 user,  load average: 0.24, 0.77, 0.76
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    111.93.235.50    07:41    4.00s  0.07s  0.05s w
vitalpointz IOT Core >

 

 

About vitalpointz,Inc

vitalpointz is a software maker that specializes on developing and offering IOT platform softwares & services. IOT Devices and sensors can be registered on the IOT Platform and on-boarded securely. IOT devices can send or receive data securely, application can be built, Over-the Air software updates can be rolled out to the devices at scale. Vitalpointz IOT Platform also provides various interface methods to transfer the data to external third-party tools and platforms, if so desired. Vitalpointz IOT Platform also bundles various device agents.

For more information about our product please check our product documentation here.

If you have any enquires, reach out to us via email : info@vitalpointz.net