To get current date and time Python offers “datetime”. To format the output according to your needs you can use “strftime”, otherwise a month would for example be shown as 8 instead of 08.
from datetime import datetime
i = datetime.now()
print i.strftime('%Y/%m/%d %H:%M:%S')
Here you can find a lot of interesting material in regards of Red Hat best practices, reference architectures, whitepapers an many more:
Follow this Red Hat resources.
On RHEL OSP 6 Juno it
s a bit tricky to find out on which OSP controller the Pacemaker router service for a specific tenant is currently running on. It might be that all routers are running on the same controller but it also can happen that every tenant specific router is running on a different controller node. Continue reading
This article shortly describes how to configure the VNC console access to OpenStack instances through Horizon in a high-availability environment. This configuration is currently valid for OpenStack Juno or RHEL OSP 6. If you change these settings after you already deployed instances in your environment theses changes only takes effect for instances which are created AFTER your changes described here. Continue reading
It may happen that you encounter slow network performance between Openstack instances running on different compute nodes or between corporate network and your Openstack instances. If so then please do the following: Continue reading
Foreman uses common ERB style templating. Foreman templates consists of a mixture of Bash scripts and appropriate macros and functions. You can find a list of built-in macros and functions here. Within such macro you can use further Ruby code. For example to extract the last digits og an IP address you can use the following macro:
Where @host.ip is a built-in macro in Foreman (see link above), to_s is Ruby code and means “convert into string”, split wherever you find a “.” and read the output reverse and take the last value (“-1”).
If you want to check if a template will render correctly for an appropriate host you can open your template in your browser:
If you want to use for example a central NFS export with your Nagios configuration under /etc/nagios on your Nagios server the nfs mount is basically mounted with the “nfs_t” context. To start Nagios you need the context “nagios_etc_t” for /etc/nagios instead. Unfortunately a simple “semanage fcontext -a -t …” is not sufficient. You need to add the context as a mount option to your /etc/fstab file like this:
server:/export /etc/nagios nfs vers=4,context="system_u:object_r:nagios_etc_t:s0" 0 0
Working in a customer project with RHEL OSP 6 and CEPH Enterprise is somehow challenging Here are some experiences especially with CEPH Monitor. Continue reading
Scenario: You want to create a custom CentOS 7 / RHEL 7 boot CD with custom kickstart files located on the CD. Furthermore you want to perform some post installation tasks like running some Puppet manifests. In this post I describe the process based on CentOS 7.1.
If you open a file with vim then it is often very helpful to know the line number which you currently editing. To display line numbers within vim you can enable them every time you start vim with:
To enable line numbers permanently you can add the following line to /etc/vimrc (if you want to enable line numbers globally) or to ~/.vimrc (if you want to enable them only for your personal user):
echo set number >> /etc/vimrc