ArcGIS Blog

Administration

ArcGIS Enterprise

Monthly Linux Tip: Helpful SysAdmin Commands for Non-SysAdmins

By Markus Walker

NOTE: This Monthly Linux Tip is geared towards an audience with little to no Linux experience. If you are experienced working in the command line, you may find the information of less value.

For a system administrator with Unix/Linux experience, working in the command line is almost second nature. Alternatively, you may find you have little to no Linux experience, but you are tasked with troubleshooting ArcGIS Enterprise in the command line.

If the latter sounds familiar to you, then this Monthly Linux Tip may be for you! This blog serves to give basic Linux users a set of basic command-line tools that sysadmins utilize to help troubleshoot a Linux system. We will explore various commands in the following areas: diagnostics, disk space, performance and memory.

Diagnostics

ArcGIS Enterprise on Linux comes with helpful diagnostic check tools that can be ran. These checks are the same checks that are ran at initial installation time. See below for ArcGIS Server’s serverdiag tool:

Portal for ArcGIS and ArcGIS Data Store have similar tools named portaldiag and datastorediag, respectively. Often times, system administrators may have a need to change the hostname of a machine. Portal for ArcGIS, in particular, is heavily reliant on the hostname used during installation time. One issue that some ArcGIS Enterprise users face is a change in a machine’s hostname causes published services to no longer be accessible. If proper precautions are not taken before the hostname change, this issue can escalate quickly. These built in diagnostic scripts can help determine if the hostname indeed is an issue.

In Windows and Linux, there additionally is an admin tool for ArcGIS Server known as serverscan. As the name implies, this Python script runs a scan on your ArcGIS Server site.

Disk Space

One of the top concerns for a system administrator is the disk space of their machines. When working with ArcGIS Enterprise, low disk space can AND will cause instability with your workflows. For example, consider the imaginary company ABC. Users of ABC’s ArcGIS Enterprise could access the Portal for ArcGIS homepage on Monday. However, now it is Friday and the Portal homepage gives a blank white screen. Upon further investigation, company ABC determines the issue is that the system hosting Portal for ArcGIS is below the recommended disk space. That is one example as to why it is highly recommended to continuously monitor disk space.

Let’s take a look at the first command, df -h:

The df (or disk free) command reports the system’s disk space usage. The ­-h flag prints the disk space usage in human-readable form. Additionally, we can drill down the disk space usage into specifics of files and directories as shown below with the du command:

du (or disk usage) is similar to df, but differs in that it estimates the file space usage. The max-depth=1 flag shows the estimated size for every file and directory in the current working directory.

Performance

It’s not enough for a system to be up and running; it must also have optimized performance. When considering performance, the top command is usually the first command that comes to mind. For comparison to Windows, top is the equivalent to Window’s Task Manager to get a dynamic viewing of processes.

Specifically, when working with ArcGIS Enterprise, a helpful manipulation of the command is top -c -u <ArcGIS Installation User> (i.e. top -c -u arcgis):

If any component of ArcGIS Enterprise appears to not be running, the top command is the first command to run to verify. A fancier version of top comes in the form of htop:

Memory

We discussed disk space’s place at the table, but memory must also have a seat in this discussion. In a nutshell, the free command displays the amount of free and used physical and swap memory in a system. See below for the free and used memory in MB format:

Shown above, the memory and swap are shown with helpful information. Free filters the above information by parsing the file /proc/meminfo. Running cat /proc/meminfo will give the system’s full memory information:

Note: The above photo is a snippet of the full cat /proc/meminfo command.

Virtual memory statistics are important for a sysadmin as they tell information on processes, memory, CPU activity and disks. As with free, the common method of checking virtual memory statistics is with the command vmstat -s as below:

Conclusion

There are many command-line based tools that can be discussed, but in this blog we discussed some in the following areas: diagnostics, disk space, performance and memory.

Please feel free to leave a comment on this blog and thanks for reading this Monthly Linux Tip!

Share this article

Subscribe
Notify of
0 Comments
Oldest
Newest
Inline Feedbacks
View all comments