Appendix A. Command Line Config Management Tools

In addition to the options provided in the RHN website, Red Hat Network offers two command line tools for managing configuration files: the Red Hat Network Configuration Client and the Red Hat Network Configuration Manager. If you don't yet have these these tools installed, they can be found within the RHN Provisioning child channel for your operating system.

A.1. Red Hat Network Configuration Client

As the name implies, the Red Hat Network Configuration Client (rhncfg-client) is to be installed and run from an individual client system. From there you may use it to gain knowledge about how RHN will deploy configuration files to the particular system.

The Red Hat Network Configuration Client offers these primary modes: list, get, channels, diff, and verify.

A.1.1. Listing Config Files

To list the configuration files for the machine and the labels of the config channels containing them, issue the command:

rhncfg-client list

You should see output resembling:

     Config Channel   File
  config-channel-17   /etc/foo.txt
  config-channel-17   /var/spool/aalib.rpm
  config-channel-14   /etc/foo.txt

A.1.2. Getting a Config File

To download the most relevant configuration file for the machine, issue the command:

rhncfg-client get /etc/foo.txt

You should see output resembling:

Deploying /etc/foo.txt

You may then more the file to view its contents. Note that the file is selected as most relevant based upon the rank of the config channel containing it. This is accomplished within the Configuration tab of the System Details page. Refer to Section 6.4.2.6 System Details for instructions.

A.1.3. Viewing Config Channels

To view the labels and names of the config channels that apply to the system, issue the command:

rhncfg-client channels

You should see output resembling:

Config channels:
Label                           Name
-----                           ----
config-channel-17               config chan 2
config-channel-14               config chan 1

A.1.4. Differentiating between Config Files

To obtain a difference between the config files deployed on the system and those for it stored by RHN, issue the command:

rhncfg-client diff

You should see output resembling:

--- /tmp/@3603.0.rhn-cfg-tmp    2004-01-13 14:18:31.000000000 -0500
+++ /etc/foo.txt        2003-12-16 21:35:32.000000000 -0500
@@ -1,3 +1,5 @@
+blaaaaaaaaaaaaaaah

In addition, you may include the --topdir option to compare config files in RHN with those located in an arbitrary (and unused) location on the system, like so:

[root@ root]# rhncfg-client diff --topdir /home/test/blah/
/usr/bin/diff: /home/test/blah/etc/foo.txt: No such file or
directory
/usr/bin/diff: /home/test/blah/var/spool/aalib.rpm: No such file or
directory

A.1.5. Verifying Config Files

To quickly determine if files are different than those associated with it in RHN, issue the command:

rhncfg-client verify

You should see output resembling:

 modified /etc/foo.txt
          /var/spool/aalib.rpm

The file foo.txt is locally modified, while aalib.rpm is not.