rack - Fetch information and generate config files for RackObjects
rack [--config /etc/rack.conf] <action> <action options> <object> rack { --help | --man | --version }
Specify the path to the configuration file. Default to /etc/rack.conf
Run the program in verbose mode.
Specify an alternate login for connecting onto the device.
Specify an alternate password for connecting onto the device.
Specify an alternate template path for RackMan::Format::DHCP.
Specify a comma-separated list of formats, overriding the corresponding [device:*]/formats parameters in rack.conf
[device:*]/formats
Specify an alternate template path for RackMan::Format::Kickstart.
Do not write the device specific file of the given RackObject.
Alias for the --formats and --no-write-device-config options.
--formats
--no-write-device-config
Specify the path of the output file for the Generic format.
Specify an alternate template path for RackMan::Format::PXE.
Specify an alternate SNMP read community.
Use a SCM program to version generated files. Enabled by default (use --no-scm to disable).
--no-scm
Specify the path of the template file for the Generic format.
Specify an alternate SNMP write community.
Print a short usage description, then exit.
Print the manual page of the program, then exit.
Print the program name and version, then exit.
Arguments are expected to be:
the action name: diff, dump, info, list, push, write
optional action options
the RackObject name
rack is a command for fetching information from a RackTables database about selected RackObjects, generate the corresponding configuration files and talk with the corresponding devices to set them up accordingly.
Print the list of RackObjects of the given type (server, pdu, switch or all)
server
pdu
switch
all
Options
as - specify the format: ldif, simple (default)
as
ldif
simple
Print information about the RackObject
Print the structure of the RackObject
as - specify the format: json, ldif, perl, yaml (default)
json
perl
yaml
Print the differences between the actual and expected configuration of the device. Set exit status to 1 if there are differences, 0 otherwise.
Generate and write the configuration files corresponding to the RackObject
Push the configuration to the device corresponding to the RackObject.
List all the PDUs:
rack list pdu
List all the servers in LDIF format:
rack list servers as ldif
Print information about "front01.example.com" in default format (YAML):
rack info front01.example.com
Dump information about "front01.example.com" in JSON format:
rack dump as json front01.example.com rack dump front01.example.com as json
Write all the configuration files for "front01.example.com":
rack write frontal01.example.com
Only write the DHCP file for "front01.example.com":
rack write -G DHCP frontal01.example.com
Process the template input.tmpl with the information about "front01.example.com" and print the result on screen:
rack write -G Generic -t input.tmpl frontal01.example.com
Process the template input.tmpl with the information about "front01.example.com" and write the result on disk, in a file named after the device:
rack write -G Generic -t input.tmpl -o %name%.conf frontal01.example.com
The configuration file is expected to be in the .INI format, with the following sections and parameters.
.INI
All parameters can be overridden in a per-device file named rack.local.conf, read from [general]/path (read below).
[general]/path
Parameters can contain placeholders that will be replaced with values corresponding to the given RackObjet:
%name% - name of the RackObject, or "unknown" if it is undefined
%name%
"unknown"
default_scm - specify the default SCM program
default_scm
dns_servers - specify the list of default DNS servers (space separated)
dns_servers
mail_server - specify the default SMTP server
mail_server
nagios_url - specify the URL of the Nagios web application
nagios_url
ntp_servers - specify the list of default NTP servers (space separated)
ntp_servers
path - (mandatory) specify the path for device-specific configuration files, including rack.local.conf; it is therefore strongly suggested to use the %name% placeholder somewhere in the value
path
racktables_url - specify the URL of the RackTables web application
racktables_url
timezone - specify the default timezone
timezone
dsn - DBI data source name (e.g.: dbi:mysql:racktables)
dsn
dbi:mysql:racktables
user - database user name
user
password - database password
password
formats - specify the formats associated with a PDU object as a space seperated list. Default is "Cacti Nagios"
formats
"Cacti Nagios"
ftp_login - specify the FTP login; can be overridden with the --device-login option
ftp_login
--device-login
ftp_password - specify the FTP password; can be overridden with the --device-password option
ftp_password
--device-password
mail_address - specify the contact address for the device
mail_address
write_community - specify the SNMP write community (needed to restart the device); can be overridden with the --write-community option
write_community
--write-community
formats - specify the formats associated with a Server object as a space seperated list. Default is "DHCP PXE Kickstart Cacti Nagios Bacula"
"DHCP PXE Kickstart Cacti Nagios Bacula"
admin_password - (mandatory) specify the iLO password for the custom account "admin"; can be overridden with the --device-password option
admin_password
ilo_password - (mandatory) specify the iLO password for the factory account "Administrator"
ilo_password
license_key - specify the license key
license_key
serial_cli_speed - specify the serial CLI speed; the value can be one of the following: 1 (9,600 bps), 2 (19,200 bps), 3 (38,400 bps), 4 (57,600 bps), 5 (115,200 bps).
serial_cli_speed
formats - specify the formats associated with a Switch object as a space seperated list. Default is "Cacti Nagios"
ios_password - specify the IOS access password; can be overridden with the --device-password option
ios_password
enable_password - specify the IOS admin password
enable_password
password - specify Bacula password
path - specify the location to store the generated files
path - specify the location of Cacti CLI programs
php - specify the path of the php(1) CLI interpreter
php
sudo_as - specify an optional user account to execute the Cacti programs under, using sudo(8)
sudo_as
template - specify the path of the template. See "TEMPLATE PARAMETERS" in RackMan::Template for the supported parameters.
template
Sebastien Aperghis-Tramoni (sebastien@aperghis.net)
To install RackMan, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RackMan
CPAN shell
perl -MCPAN -e shell install RackMan
For more information on module installation, please visit the detailed CPAN module installation guide.