What Does It Mean When a Search in ServiceNow Returns “No records found”?

Problem scenario
In ServiceNow you search for an item, but the searches return "No records found."  You are given a hyperlink to a case, but you see "Record not found" despite being logged into the web UI for ServiceNow.  What is going on or what is wrong?

Solution
It is possible that the hyperlink had a typo or that the search term literally could not find a matching record.  But there is another explanation that is possible.

It could by that you do not have membership to the appropriate group (behind-the-scenes thus you have no visibility to it).  The behavior you find in ServiceNow could be attributable to your account not having insufficient permissions.   ServiceNow has a SQL database on the back-end.  Ask your ServiceNow administrator to see if your account is a member of the Access Control List.  You may want to post a question on community.servicenow.com or look here.

How Do You Get the gatling.sh Script to Work when You Get an Error about There Not Being a Simulation Script?

Problem scenario
You run gatling.sh but you receive this error: "There is no simulation script. Please check that your scripts are in user-files/simulations".  What should you do?

Possible solution #1
Go to the subdirectory user-files/simulations/.  Place a .scala file there that is a simulation script.

Possible solution #2
Run the gatling.sh script with "sudo" before the command like this:  sudo bash gatling.sh

Possible solution #3
Change the ownership and or permissions of user-files/simulations/*.scala files. 

Possible solution #4
Reinstall Gatling. You can use these directions.

How Do You Troubleshoot an Ansible Problem about Missing Quotes when You Have Quotes around Each Variable?

Problem scenario
You run an Ansible playbook but you get an error about "this one looks like it might be an issue with missing quotes."  Your Ansible playbook compares two variables with each other.  

After running ansible-playbook on the .yaml file, you get this error:

"ERROR! Syntax Error while loading YAML.
  expected <block end>, but found '<scalar>'

The error appears to have been in '/home/cooluser/good.yaml': line 12, column 36, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  - shell: echo "THIS STATEMENT IS EXECUTED" > /tmp/printer.txt
    when: "{{ ansible_hostname }}" == "{{ ansible_nodename }}"
                                   ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes.  Always quote template expression brackets when they
start a value. For instance:

    with_items:
      - {{ foo }}

Should be written as:

    with_items:
      - "{{ foo }}""

How do you get the comparison to work?

Solution
Put single quotes around the entire expression including the == (or !=) symbol.  

Example of an incorrect when (if) statement:

  - shell: echo "THIS STATEMENT IS EXECUTED" > /tmp/printer.txt
    when: "{{ ansible_hostname }}" == "{{ ansible_nodename }}"

The above has two variables on each side of an equivalence condition.  With Ansible 2.1, it will throw an error.

Here is an example of a correct when: statement (with single quotes around everything except the "when:"):

  - shell: echo "THIS STATEMENT IS EXECUTED" > /tmp/printer.txt
    when: '"{{ ansible_hostname }}" == "{{ ansible_nodename }}"'

How Do You Get Your GPS to Get Traffic and Show Your Position Properly?

Problem scenario
Your GPS is not working properly.  The traffic updates and satellites for the maps are not working correctly.  What is wrong?

Possible solution #1
The cord should be unravelled.  They often are supposed to work as antennas.  Bundled up the cord may not work as an antenna.  Place as much of the cord along the dashboard as possible.  This way there is a clear path to the sky.

Possible solution #2
You are underground or in a tunnel.  You may have lost the signal that way.  When you get out of the tunnel, you may get the latest information again.

Possible solution #3
You have driven out of your GPS's map regions.  Many GPSes only have a subsection of the country.  You may need to change the maps on your device.  But this will take time and you will lose some regions of the maps that you had.  To overcome a restriction of space on your GPS, you may want to buy a micro SSD card to insert into your GPS to get more maps saved on your device.  In the long run you can save time this way.

Possible solution #4
Purchase a new GPS here.

How Do You Delete the Git Credentials You Entered Into Jenkins for “Source Code Management”?

Problem scenario
In a Jenkins job there is a "Source Code Management" section.  You checked Git and entered credentials.  You entered the same username twice (or more).  Now you want to delete some of those users to be able to know which (unique) password is being used.  What should you do?

Solution
It isn't always easy to find where the credentials for your Git repository are stored.  There are different ways of finding them.

Possible solution #1
Go to the home page of Jenkins.  Then go to "Credentials".  (It is not Git-based.  You can see this link for more information.)

Possible solution #2
Go to the home page of Jenkins.  Go to another master.  Then go to "Credentials".

Possible solution #3
Go to the home page of Jenkins.  Go to a project folder (for the job of the credentials you want to change).  Then go to "Credentials".

Possible solution #4
Go to the home page of Jenkins.  Go to the job of the credentials that you want to change.  Then go to "Credentials".

How Do You Install Gatling on a CentOS/RHEL/Fedora server?

Problem scenario
You are using a Red Hat derivative of Linux.  You want to install Gatling.  What do you do?

Solution
Prerequisite

Install Java.  If you need assistance, see this posting.

Procedures
1.  Run a script with the following content (e.g., name it installgatling.sh and run sudo bash installgatling.sh):

gatlingversion=3.3.1    # change this version as needed.  Go to gatling.io for the latest details.
curl -L https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/$gatlingversion/gatling-charts-highcharts-bundle-$gatlingversion-bundle.zip > /tmp/gatling-charts-highcharts-bundle-$gatlingversion-bundle.zip

yum -y install unzip
cd /tmp/
unzip gatling-charts-highcharts-bundle-$gatlingversion-bundle.zip
mv gatling-charts-highcharts-bundle-$gatlingversion /opt/gatling
echo "Now go to the /opt/gatling/bin/ directory and run gatling.sh with 'sudo bash gatling.sh'"

2.  These are optional steps if you want Gatling's results to be presented in a web UI:

Gatling provides visual results of its stress tests.

Install and configure either Apache Web Server of Nginx on the Gatling server.  If you want assistance, see this posting for installing Apache Web Server on a CentOS/RHEL/Fedora server.  For a Debian/Ubuntu server, see this posting to install Apache Web Server.  If you want assistance on installing Nginx, see this posting.

After the gatling.sh script runs it should indicate where the results are.  It will say something like this: "Please open the following file: /opt/gatling/results/basicsimulation-1530041190858/index.html"

Find out where your default directory is for your webserver.  The file would be httpd.conf for Apache web server on a Red Hat distribution of Linux (e.g., CentOS or Fedora).  The file would be apache2.conf for Apache web server on a Debian/Ubuntu distribution of Linux.  The "DocumentRoot" stanza would signify where the directory is.  It may look like this:

DocumentRoot "/var/www/html/"

For these examples, you would run these commands to get the results as web presentable:

sudo mkdir /var/www/html/gatling
sudo cp -R /opt/gatling/results/basicsimulation-1530041190858/ /var/www/html/gatling

Open the web browser and go to http://x.x.x.x/gatling/index.html to view the results (where x.x.x.x is the external IP address of the web server).

How Do You Set up an nfs File Share between Two Linux Servers in GCP?

Problem scenario
You want to be able to share a directory between two Red Hat distribution Linux servers.  How do you expose an NFS share on one Linux server and make it viewable for reads and writes from a second Linux server?

Solution
Prerequisites
You have install nfs-utils on both servers.  To do this, run this command:  sudo yum -y install nfs-utils

Procedures
Designate one server to host the nfs server.  This will be the "nfs server."  Designate the other server as the client of the nfs server (or "nfs client").  In GCP we found that using the internal IP addresses worked well when the directions below call for a server IP address.  But you may adapt this solution to a non-GCP pair of servers.

1.  From the nfs server, do the next three steps (through step #4).
2.  Make the directory that will be exported as an nfs share (e.g., sudo mkdir -p /usr/bin/contint).
3.  Modify the /etc/exports file (or create one if necessary).  Add a line like this (but replace x.x.x.x with the IP address of the nfs client server and replace "/usr/bin/contint" with the directory created in step #2):

/usr/bin/contint x.x.x.x(rw,sync,no_root_squash)

4.a.  Run this command:  sudo service nfs start

4.b.  If you want the nfs service to be available after a reboot, you will have to do this:

sudo crontab -e   # to modify the crontab.  add the line below then save it (usually by pressing the Escape key then uppercase Z twice, e.g., Esc ZZ)

@reboot sudo service nfs start

5.  Log into the nfs client server.  Run the following commands from the nfs client server.   
6.  Make a directory that will be the place where you read and write to the nfs file share.  Here is an example:  sudo mkdir -p /usr/bin/viewable

7.  Run this command but replace x.x.x.x with the IP address or hostname of the nfs server: sudo showmount -e x.x.x.x

8.  Compose a command like this, but make three replacements as described below it:

sudo mount -t nfs x.x.x.x:/dir/path/above /usr/bin/viewable

i.  Replace "x.x.x.x" with the IP address or hostname of the nfs server.
ii.  Replace "/dir/path/above" with the directory referred to in the results from step #7.  
iii.  Replace "/usr/bin/viewable" with the directory you created in step #6 above.

9.  Run the command composed above.

10.  Verify it work by running this:  ls -lh /usr/bin/viewable

11.  If you want the nfs share to be usable after a reboot of the client, run a command like this: echo 'sudo mount -t nfs x.x.x.x:/dir/path/above /usr/bin/viewable' >> ~/.bashrc

(Remember to replace "sudo mount -t nfs x.x.x.x:/dir/path/above /usr/bin/viewable" with the command composed in step #8.)

How Do You Troubleshoot the Ansible Error “Unsupported parameters for (copy) module: become Supported parameters”?

Problem scenario
You are trying to run an Ansible playbook with the "become: yes" stanza.  You get this error after your ansible-playbook command:

fatal: [instance-11]: FAILED! => {"changed": false, "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "msg": "Unsupported parameters for (copy) module: become Supported parameters include: _original_basename, attributes, backup, checksum, content, delimiter, dest, directory_mode, follow, force, group, local_follow, mode, owner, regexp, remote_src, selevel, serole, setype, seuser, src, unsafe_writes, validate"}

Solution
Unindent the "become: yes" stanza so it is at the same level of its corresponding module.

Here is an example of an incorrect indentation:

- hosts: all
  tasks:
  - copy:
      src: /home/cooluser/swapspace.sh
      dest: /home/cooluser/swapspace.sh
      owner: cooluser
      group: wheel
      mode: 0644
      become: yes

Here is an example of a correct indentation:

- hosts: all
  tasks:
  - copy:
      src: /home/cooluser/swapspace.sh
      dest: /home/cooluser/swapspace.sh
      owner: cooluser
      group: wheel
      mode: 0644
    become: yes

How Do You Iterate through a List of Servers When Running an Ansible Playbook?

Problem scenario
You want an Ansible playbook to run on specific managed nodes.  You can create a list of the servers you want the playbook to apply to.  How do you provide a list of specific hostnames and have the Ansible playbook run on each server?

Prerequisites
This assumes that you have installed Ansible and have it working with the managed nodes you want to run a playbook on.  For directions on deploying Ansible, see this posting.

Procedures
You could modify the inventory file on your Ansible server.  But if you want a list for an ad hoc run of an Ansible playbook, do the following:

1.  In the .yaml or .yml file of your playbook, create a stanza like this:

hosts:  coolgroupofservers

2.  Create a file with an arbitrary name in the same directory as your playbook.  Call it something like foobar.txt

3.  Have foobar.txt have the following content:

[coolgroupofservers]
FQDN1
FQDN2
FQDN3

4.  Run the Ansible playbook (e.g., goodpb.yaml) with the -i flag to call the foobar.txt file:

ansible-playbook goodpb.yaml -i foobar.txt

How Do You Browse SonarQube and Interact with It as a Web UI from the Front-End?

Problem scenario
You run a "sudo ps -ef | grep sonar" and find Sonar to be running.  You run "sudo sytemctl status sonar" and find that it is active.  You run nmap or netstat and see port activity from the sonar service.  Sonar is listening.  When you go to a web browser over the right port (e.g., http://x.x.x.x:9000/) you do not see any web page.  There is no evidence you can connect.  How do you log into SonarQube via a web browser?

Solution
Use "/sonar" in the URL.  Rather than a program like Jenkins, the URL may need to be constructed with a "/sonar" appended to it like this:

http://x.x.x.x:9000/sonar

#  Where x.x.x.x is the external IP address of the server.  You can find it by running this command from the back-end: ip addr show | grep inet

You will ignore the 127.0.0.1 from the results.  You can change the base URL in sonar.properties.  If you want to do this, see this posting.