B.3. Red Hat Network Configuration Manager
rhncfg-manager) is designed to maintain RHN's central repository of config files and channels, not those located on client systems. This tool offers a command line alternative to the configuration management features within the RHN website, as well as the ability to script some or all of the related maintenance.
/etc/sysconfig/rhn/rhncfg-manager.conf or in the [rhncfg-manager] section of ~/.rhncfgrc.
~/.rhncfgrc file. The session file is cached in ~/.rhncfg-manager-session to prevent logging in for every command.
server.session_lifetime option and new value to the /etc/rhn/rhn.conf file on the server running the manager, like so:
server.session_lifetime = 120
rhncfg-manager mode --help
rhncfg-manager diff-revisions --helprhncfg-manager add options”.
B.3.1. Creating a Config Channel
rhncfg-manager create-channel channel-label
Red Hat Network username: rhn-user Password: Creating config channel channel-label Config channel channel-label created B.3.2. Adding Files to a Config Channel
rhncfg-manager add --channel=channel-label /path/to/file--dest-file option in the command, like:
rhncfg-manager add --channel=channel-label--dest-file=/new/path/to/file.txt/path/to/file
Pushing to channel example-channel Local file >/path/to/file -> remote file /new/path/to/file.txt rhncfg-manager add:
Table B.4. rhncfg-manager add options
| Option | Description |
|---|---|
| -cCHANNEL --channel=CHANNEL | Upload files in this config channel |
| -dDEST_FILE --dest-file=DEST_FILE | Upload the file as this path |
| --delim-start=DELIM_START | Start delimiter for variable interpolation |
| --delim-end=DELIM_END | End delimiter for variable interpolation |
| -h, --help | show help message and exit |
Note
/etc/rhn/default/rhn_web.conf file:
web.maximum_config_file_size=128
/etc/rhn/default/rhn_server.conf file:
maximum_config_file_size=128
B.3.3. Differentiating between Latest Config Files
rhncfg-manager diff --channel=channel-label --dest-file=/path/to/file.txt \ /local/path/to/file
/tmp/dest_path/example-config.txt /home/test/blah/hello_world.txt --- /tmp/dest_path/example-config.txt config_channel: example-channel revision: 1 +++ /home/test/blah/hello_world.txt 2003-12-14 19:08:59.000000000 -0500 @@ -1 +1 @@ -foo +hello, world rhncfg-manager diff:
Table B.5. rhncfg-manager diff options
| Option | Description |
|---|---|
| -cCHANNEL, --channel=CHANNEL | Get file(s) from this config channel |
| -rREVISION, --revision=REVISION | Use this revision |
| -dDEST_FILE, --dest-file=DEST_FILE | Upload the file as this path |
| -tTOPDIR, --topdir=TOPDIR | Make all files relative to this string |
| -h, --help | Show help message and exit |
B.3.4. Differentiating between Various Versions
-r flag to indicate which revision of the file should be compared and the -n flag to identify the two channels to be checked. Refer to Section B.3.11, “Determining the Number of File Revisions” for related instructions. Specify only one file name here, since you are comparing the file against another version of itself. For example:
rhncfg-manager diff-revisions -n=channel-label1-r=1-n=channel-label2-r=1/path/to/file.txt
--- /tmp/dest_path/example-config.txt 2004-01-13 14:36:41 \ config channel: example-channel2 revision: 1 --- /tmp/dest_path/example-config.txt 2004-01-13 14:42:42 \ config channel: example-channel3 revision: 1 @@ -1 +1,20 @@ -foo +blaaaaaaaaaaaaaaah +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.0.6 (GNU/Linux) +Comment: For info see http://www.gnupg.org + +iD8DBQA9ZY6vse4XmfJPGwgRAsHcAJ9ud9dabUcdscdcqB8AZP7e0Fua0NmKsdhQCeOWHX +VsDTfen2NWdwwPaTM+S+Cow= +=Ltp2 +-----END PGP SIGNATURE----- rhncfg-manager diff-revisions:
Table B.6. rhncfg-manager diff-revisions options
| Option | Description |
|---|---|
| -cCHANNEL, --channel=CHANNEL | Use this config channel |
| -rREVISION, --revision=REVISION | Use this revision |
| -h, --help | Show help message and exit |
B.3.5. Downloading All Files in a Channel
rhncfg-manager download-channel channel-label --topdir .
Copying /tmp/dest_path/example-config.txt -> \ blah2/tmp/dest_path/example-config.txt rhncfg-manager download-channel:
Table B.7. rhncfg-manager download-channel options
| Option | Description |
|---|---|
| -tTOPDIR, --topdir=TOPDIR | Directory all the file paths are relative to. This option must be set. |
| -h, --help | Show help message and exit |
B.3.6. Getting the Contents of a File
rhncfg-manager get --channel=channel-label \ /tmp/dest_path/example-config.txt B.3.7. Listing All Files in a Channel
rhncfg-manager list channel-label
Files in config channel `example-channel3': /tmp/dest_path/example-config.txt rhncfg-manager get:
Table B.8. rhncfg-manager get options
| Option | Description |
|---|---|
| -cCHANNEL, --channel=CHANNEL | Get file(s) from this config channel |
| -tTOPDIR, --topdir=TOPDIR | Make all files relative to this string |
| -rREVISION, --revision=REVISION | Get this file revision |
| -h, --help | Show help message and exit |
B.3.8. Listing All Config Channels
rhncfg-manager list-channels
Available config channels: example-channel example-channel2 example-channel3 config-channel-14 config-channel-17 local_override or server_import channels.
B.3.9. Removing a File from a Channel
rhncfg-manager remove --channel=channel-label /tmp/dest_path/example-config.txt
Red Hat Network username: rhn-user Password: Removing from config channel example-channel3 /tmp/dest_path/example-config.txt removed rhncfg-manager remove:
Table B.9. rhncfg-manager remove options
| Option | Description |
|---|---|
| -cCHANNEL, --channel=CHANNEL | Remove files from this config channel |
| -tTOPDIR, --topdir=TOPDIR | Make all files relative to this string |
| -h, --help | Show help message and exit |
B.3.10. Deleting a Config Channel
rhncfg-manager remove-channel channel-label
Removing config channel example-channel Config channel example-channel removed B.3.11. Determining the Number of File Revisions
rhncfg-manager revisions channel-label /tmp/dest_path/example-config.txt
Analyzing files in config channel example-channel \ /tmp/dest_path/example-config.txt: 1 B.3.12. Updating a File in a Channel
rhncfg-manager update \ --channel=channel-label --dest-file=/path/to/file.txt /local/path/to/file
Pushing to channel example-channel: Local file example-channel/tmp/dest_path/example-config.txt -> \ remote file /tmp/dest_path/example-config.txt rhncfg-manager update:
Table B.10. rhncfg-manager update options
| Option | Description |
|---|---|
| -cCHANNEL, --channel=CHANNEL | Upload files in this config channel |
| -dDEST_FILE, --dest-file=DEST_FILE | Upload the file as this path |
| -tTOPDIR, --topdir=TOPDIR | Make all files relative to this string |
| --delim-start=DELIM_START | Start delimiter for variable interpolation |
| --delim-end=DELIM_END | End delimiter for variable interpolation |
| -h, --help | Show help message and exit |
B.3.13. Uploading Multiple Files at Once
rhncfg-manager upload-channel --topdir=topdir channel-label
Using config channel example-channel4 Uploading /tmp/ola_world.txt from blah4/tmp/ola_world.txt rhncfg-manager upload-channel:
Table B.11. rhncfg-manager upload-channel options
| Option | Description |
|---|---|
| -tTOPDIR, --topdir=TOPDIR | Directory all the file paths are relative to |
| -cCHANNEL, --channel=CHANNEL | List of channels the config info will be uploaded into. Channels delimited by ','. Example: --channel=foo,bar,baz |
| -h, --help | Show help message and exit |

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.