Posts

Testing

So, just to quickly recap our earlier analysis, we started with the incident category and identified a number of opportunities where automation can help with repeatable, deterministic incident resolution. We’ll keep that as the foundation and move ahead To continue from our last discussion, where we showcased the incident-based use-case analysis, we are now moving to the SR category. Here, we looked beyond incidents and focused on high-volume, repeatable service requests handled by the infrastructure teams. We identified approximately 175 SRs per month across Unix, Wintel, Storage and Backup. A significant portion of these are standardized, SOP-driven activities, making them good candidates for automation using RunbookAI.” Once the use cases are reviewed and approved, we will also create a DFD to illustrate the data flow and integration points for each approved use case. I have a sample DFD to show the proposed format. If you are aligned with this approach, we will create similar DFDs ...

esxcli random

 esxcli network vswitch standard policy failover set  --active-uplinks=vmnic0,vmnic1 -v vSwitch0 esxcli network vswitch standard portgroup add --portgroup-name=Prod-789  --vswitch-name=vSwitch0 esxcli network vswitch standard portgroup add --portgroup-name=Prod-787  --vswitch-name=vSwitch0 esxcli network vswitch standard portgroup set --portgroup-name=Prod-789 --vlan-id=789 esxcli network vswitch standard portgroup set --portgroup-name=Prod-787 --vlan-id=787 esxcli network vswitch standard portgroup add --portgroup-name=VMotion1 --vswitch-name=vSwitch0 esxcli network vswitch standard portgroup set --portgroup-name=VMotion1 --vlan-id=722 esxcli network ip interface add --interface-name=vmk1 --portgroup-name=VMotion1 esxcli network ip interface ipv4 set --interface-name=vmk1 --ipv4=10.232.x.x --netmask=255.255.254.0 --type=static vim-cmd hostsvc/vmotion/vnic_set vmk1 esxcli network ip dns search add --domain=corp.test.com esxcli network ip dns server add --server=10.19...

govc random

 #!/bin/sh export GOVC_URL='<VC URL>' export GOVC_USERNAME='<USERNAME>' export GOVC_PASSWORD='<PASSWORD>' export GOVC_INSECURE=1 export GOVC_DATACENTER=<DATACENTER> export no_proxy=IPs & DOMAIN date=`echo "'"$(date +%F)"'"` ################# Scan for ESXi / HW Data ####################################### for cluster in `govc ls /OpenShift/host/ | grep -v OLD | grep -v Maint|awk -F '/' '{print $4}'` do         for host in `govc ls /OpenShift/host/$cluster | grep -v Resources |awk -F '/' '{print $5}'`         do                 vendor=`echo "'"$(govc host.info /OpenShift/host/$cluster/$host | grep Manufacturer: |awk '{print $2}')"'"`                 memory=`expr  $(govc host.info /OpenShift/host/$cluster/$host | grep Memory:|awk -F 'MB' '{print $1}'|awk '{print $2}') / 1024`                 cpu...

Random One Liners

 /usr/sbin/rear -v mkbackup nfs://nas_name/linux_bkp/images  in  /etc/rear/local.conf blockdev --rereadpt /dev/sdb pvresize /dev/sdb free && sync && echo 3 > /proc/sys/vm/drop_caches && free echo 1 > /proc/sys/vm/drop_caches  echo 2 > /proc/sys/vm/drop_caches echo 3 > /proc/sys/vm/drop_caches date --set="$(ssh user@server date)" echo "body" | mailx -s "subject" test@hello.com for i in /var/spool/postfix/*;do echo $i; find $i |wc -l; done find /var/Secured_History -size  0 -print0 |xargs -0 rm zoneadm list -cv find / \( -fstype ext2 -o -fstype ext3 -o -fstype ext4 -o -fstype btrfs \) -exec setfattr -x security.selinux {} \; arp -a|grep SP timeout 1 bash -c 'cat < /dev/null > /dev/tcp/test_server/37410' append fastboot to kernel line to skip fsck ss -ln src :22 alternatives --display java find / -size +1000 -xdev -exec du -sh {} \;|sort -nk1 from jump to remote server = ssh test_server date -s @`( date -u...

F5 Health to postgrsql

 #!/bin/sh for cluster in `cat f5inventory` do clusterid=`echo $cluster |awk -F [/:-]  '{print $4}'` url=`echo https://$clusterid-master.test.com:8443/healthz` output=`curl -k  $url` if [ $output == ok ] then         stat=`echo "'"200"'"`         link=`echo "'"$url"'"`         PGPASSWORD=postgres psql -U postgres -d ocpinfra -h test_server -p 5432  -c "UPDATE f5 SET Status = $stat WHERE F5_URL=$link;" else         stat=`echo "'"400"'"`         link=`echo "'"$url"'"`         PGPASSWORD=postgres psql -U postgres -d ocpinfra -h test_server -p 5432  -c "UPDATE f5 SET Status = $stat WHERE F5_URL=$link;" fi done

Jenkins Job Cleanup

 def jobName = "Test Removal Job" def job = Jenkins.instance.getItem(jobName) job.getBuilds().each { it.delete() } job.nextBuildNumber = 1 job.save()

Grafana Setup

 [root@server grafana]# rpm -qa |grep -i grafana grafana-7.0.6-1.x86_64 [root@server grafana]# cat /etc/grafana/grafana.ini [paths] [server] [database] [remote_cache] [dataproxy] [analytics] [security] allow_embedding = true [snapshots] [dashboards] [users] [auth] [auth.anonymous] enabled = true org_name = Main Org. org_role = Viewer [auth.saml] # Enterprise only [auth.grafana_com] [auth.proxy] [auth.basic] [auth.ldap] enabled = false [smtp] enabled = true host = relay_host:25 user = testuser@gmail.com from_address = testuser@gmail.com from_name = Hello_World [emails] [log] filters = ldap:debug [log.console] [log.file] [log.syslog] [alerting] [explore] [metrics] [metrics.graphite] [tracing.jaeger] [grafana_com] [external_image_storage] [external_image_storage.s3] [external_image_storage.webdav] [external_image_storage.gcs] [external_image_storage.azure_blob] [external_image_storage.local] [rendering] [enterprise] [panels] disable_sanitize_html = true [plugins]