Main Menu

Search

Showing posts with label uptime. Show all posts
Showing posts with label uptime. Show all posts

Oracle Virtual Server (OVS): Command To Get List of Running VM's with their names, UUID, uptime on Dom0 Hypervisor

Below command can be used.
clear;for i in `xm uptime|egrep -v 'Name|Domain-0' |awk '{print $2}'`;do h=`xm uptime $i|egrep -v Name|awk '{print $1}'`;z=`xm uptime $i|egrep -v Name|awk '{print $3}'`;y=`xm uptime $i|egrep -v Name|awk '{print $4}'`;j=`find /OVS/ -name $h`;o=`grep OVM_simple_name $j/vm.cfg|awk '{print $3}'`;echo VM Name: $o VM UUID: $h Uptime: $z $y;done

Below is example output of above command.
VM Name: 'NodeManager' VM UUID: 0004fb00000600001ec36fa6da3a1473 Uptime: 18 days,
VM Name: 'infi-1' VM UUID: 0004fb00000600002b1f8fd5ee95897d Uptime: 4 days,
VM Name: 'net-6' VM UUID: 0004fb000006000042f4d8d5087a8f4c Uptime: 4 days,
VM Name: 'net-2' VM UUID: 0004fb000006000045a845ecff3d8554 Uptime: 4 days,

Products to which Article Applies

Oracle Virtual Server (OVS)

LINUX: Shell Script For Pinging Multiple IP Addresses / Hosts And Report Whether They Are UP or DOWN (How To Doc)

This article provides script which will ping multiple IP addresses / Hostnames and report if they are UP or down.

Below is the script content.

#!/bin/bash
# Program name: ping_multiple_ip_hosts.sh
echo "`date`" >>/tmp/result.out
cat /tmp/hosts |  while read output
do
    ping -c 1 "$output" > /dev/null
    if [ $? -eq 0 ]; then
    echo "node $output is up" >>/tmp/result.out
    else
    echo "node $output is down" >>/tmp/result.out
    fi
done


This script reads the IP addresses / hostnames from /tmp/hosts file. The IP addresses have to be light this in /tmp/hosts file with 1 IP or hostname per line.

10.10.10.10
10.10.10.20 

When the script is executed it redirects the output to /tmp/result.out file as follows. As you can see it prints date and whether the hosts are up or down.

Fri Aug 23 02:02:01 UTC 2019
node 10.10.10.10 is up
node 10.10.10.20 is up
Fri Aug 23 02:03:01 UTC 2019
node 10.10.10.10 is up
node 10.10.10.20 is up
Fri Aug 23 02:04:01 UTC 2019
node 10.10.10.10 is up
node 10.10.10.20 is up


Products to which Article Applies


All UNIX environments

Additional References