Pages

How to test SSL connectivity from the command line?



OpenSSL provides Secure Sockets Layer functionality for most general SSL requets.

To test the secure connections to a server, the openssl executable can be called directly using its s_client command

# openssl s_client -connect <hostname>:<port>

The conventional port for SSL HTTP connections is 443. Once the connection is made, standard HTTP requests can be typed in manually, and their output will be displayed on the terminal.This command can be used to test not only webservers (https), but smtps, imaps, and ftps connections.Another tool to test the SSL connection is curl
 

Cron Vs Anacron


Both Cron and Anacron are daemons used for job scheduling .Cron jobs can run as often as every minute. However, the utility assumes that the system is running continuously and if the system is not up at the time when a job is scheduled, the job is not executed. On the other hand, Anacron remembers the scheduled jobs if the system is not running at the time when the job is scheduled. The job is then exectuted as soon as the system is up. However, Anacron can only run a job once a day.The cron and anacron jobs are both picked by the crond  service. Just like how cron has /etc/crontab, anacron has /etc/anacrontab. 

/etc/anacrontab file has the anacron jobs mentioned in the following format.

-----------------------------------------------------------------------------------
 period in days       delay in minutes       job-identifier        command
------------------------------------------------------------------------------------

period in days — frequency of job execution in days

The property value can be defined as an integer or a macro (@daily, @weekly, @monthly), where @daily denotes the same value as integer 1, @weekly the same as 7, and @monthly specifies that the job is run once a month regardless of the length of the month. 

delay in minutes — number of minutes anacron waits before executing the job 


The property value is defined as an integer. If the value is set to 0, no delay applies. 


job-identifier — unique name referring to a particular job used in the log files 


command — command to be executed 

The command can be either a command such as ls /proc >> /tmp/proc or a command which executes a custom script. 
 

Rebuilding the initramfs in RHEL 6


It is recommended you make a backup copy of the initrd in case the new version has an unexpected problem

Now rebuild the initramfs for the current kernel version:

# dracut -f

If you are in a kernel version different to the initrd you are building you must specify the full kernel version, including architecture

For example 

# dracut -f /boot/initramfs-2.6.32-220.7.1.el6.x86_64.img 2.6.32-220.7.1.el6.x86_64

 

How to change the bonding mode without rebooting the system...



Find current bonding mode:

#cd /sys/class/net/bond0/bonding
#cat mode
 balance-rr   0   
          
The current bonding mode is round-robin.

Change the bonding mode:

#ifdown bond0
#echo 1 >mode
#cat mode
active-backup 1

Now the bonding mode has been changed to active-backup.

Up the bond0 again:

#ifup bond0

Check if the bonding mode has been changed:

#cat /proc/net/bonding/bond0

Multipath -ll command output in detail


The multipath -ll command shows the current multipath topology, this includes information regarding which path is active, how the paths are grouped, and how the meta-devices will behave in case of a complete path loss

Sample Output is given below
-----------------------------------------------------------------------------------------------------------------------
    diskname (360014380056efd060000d00000510000) dm-3 Vendor,StorageModel
    [size=1.0G][features=1 queue_if_no_path][hwhandler=0][rw]
    \_ round-robin 0 [prio=100][active]
     \_ 0:0:0:1 sda 8:0   [active][ready]
     \_ 1:0:1:1 sdd 8:48  [active][ready]
    \_ round-robin 0 [prio=20][enabled]
     \_ 0:0:1:1 sdb 8:16  [active][ready]
     \_ 1:0:0:1 sdc 8:32  [active][ready]
-----------------------------------------------------------------------------------------------------------------------

Each multipath device is defined using the following format:
-----------------------------------------------------------------------------------------------------------------------
    action_if_any: alias (wwid_if_different_from_alias)
    [size][features][hardware_handler]
------------------------------------------------------------------------------- 



Where:
  • action_if_any: If multipath is performing an action, while running the command this action will be displayed here. An action can be "reload", "create" or "switchpg"
  • alias: is the name of the multipath device as can be found under /dev/mapper/
  • wwid_if_different_from_alias: is the scsi wwid, the unique identifier of the LUN
  • size: is the size of the multipath devices
  • features: is a list of all the options enabled for this multipath device (e.g. queue_if_no_path)
  • hardware_handler: This is 0 if no hardware handler is in use. This is 1 and the name of the hardware handler kernel module in use.
For each path group:

---------------------------------------------------------------------------------------------------------------------- 

\_ scheduling_policy [path_group_priority_if_known] [path_group_status_if_known]

-------------------------------------------------------------------------------
for example:
----------------------------------------------------------------------------------------------------------------------
    \_ round-robin 0 [prio=100][active]
-------------------------------------------------------------------------------
Where:
  • scheduling_policy: is the path selector algorithm in use for this path group
  • path_group_priority_if_known: Each path can have a priority assigned to it by a callout program. Path priorities can be used to group paths by priority and change their relative weights for the algorithm that defines the scheduling policy.
  • path_group_status_if_known: The status of the path can be one of the following:
    • active - Path group currently receiving I/O requests.
    • enabled - Path groups to try if the active path group has no paths in the ready state.
    • disabled - Path groups to try if the active path group and all enabled path groups have no paths in the active state.
For each path:
---------------------------------------------------------------------------------------------------------------------------
    \_ host:channel:id:lun devnode major:minor [dm_status_if_known] [path_status]
----------------------------------------------------------------------------------
for example:
---------------------------------------------------------------------------------------------------------------------------
    \_ 5:0:0:1 sdk 8:160 [active][ready]
----------------------------------------------------------------------------------



Where:
  • host:channel:id:lun: are the SCSI host, channel, id and lun values that identify the LUN
  • devnode: is the name of the device
  • major:minor: the major and minor number of the block device
  • dm_status_if_known: Is similiar to the path status, but from the  kernel's point of view. The dm status has two states: "failed", which is  analogous to "faulty", and "active" which covers all other path states.
  • path_status: the status of the path can be one of the following:
    • ready - Path is able to handle I/O requests.
    • shaky - Path is up, but temporarily not available for normal operations.
    • faulty - Path is unable to handle I/O requests.
    • ghost - Path is a passive path, on an active/passive controller.
  • dm_status_if_known: Is similiar to the path status, but from the kernel's point of view. The dm status has two states:
    • failed - which is analogous to "faulty", and
    • active - which covers all other path states.