Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Sunday, 1 January 2017

Packstack Openstack Installation

After installing CentOS 7
Instal RDO
#yum install -y https://rdoproject.org/repos/rdo-release.rpm

Because installation not compatible with openstack-packstack
#systemctl stop NetworkManager; systemctl disable NetworkManager

Install openstack
#yum install -y centos-release-openstack-mitaka

Install packstack
#yum install -y openstack-packstack

get the answer file
# packstack --gen-answer-file /root/answers.txt


change with your options
CONFIG_NTP_SERVERS=pool.ntp.org
CONFIG_KEYSTONE_ADMIN_PW=password
CONFIG_DEFAULT_PASSWORD=password
CONFIG_HORIZON_SSL=y
CONFIG_PROVISION_DEMO=n


start installation
#packstack --answer-file /root/answers.txt



You may face this error

Preparing Nova VNC Proxy entries [ ERROR ]

ERROR : [Errno 2] No such file or directory: '/etc/pki/tls/certs/selfcert.crt'
Please check log file /var/tmp/packstack/20161109-192844-cGjfCc/openstack-setup.log for more information


Solution:
# openssl req -x509 -sha256 -newkey rsa:2048 -keyout selfkey.key -out selfcert.crt -days 1024 -nodes
# cp selfkey.key /etc/pki/tls/private/
# cp selfcert.crt /etc/pki/tls/certs

change answer file
CONFIG_SSL_CERT_DIR=/root/packstackca/

and put your ip here
ln -s /etc/pki/tls/certs/ssl_vnc.crt/root/packstackca/certs/PUTYOURIPssl_vnc.crt

Tuesday, 9 August 2016

Devstack installation , Ubuntu

Devstack installation on Ubuntu 14.04 server version.  I installed on Vmware Player. 

$ adduser stack

Install sudo if not installed 
$ apt-get install sudo -y 

Adding user to sudo group 
$ sudo adduser stack sudo 

Install git 
$ sudo apt-get install git -y

Devstack clone
$ git clone https://git.openstack.org/openstack-dev/devstack

$ cd devstack 

Config file copy 
$ cp ./samples/local.conf  .



Edit local.conf file
FLOATING_RANGE a range not used on the local network
FIXED_RANGE to configure the internal address space used by the instances
FLAT_INTERFACE to the Ethernet interface that connects the host to your local network 

FLOATING_RANGE=192.168.1.0/24
FIXED_RANGE=192.168.149.1/24
FLAT_INTERFACE=eth1

This is could be goog if you have multiple network card 
HOST_IP=127.0.0.1

Start installation
$./stack.sh 


You can get these kind of errors, also find solution here 

Error
[ERROR] /home/stack/devstack/functions-common:604 git call failed: [git clone https://github.com/kanaka/noVNC.git /opt/stack/noVNC

Solution 
Download noVNC from github, extract as /opt/stack/noVNC .
And run ./stack.sh again. 


Error
OfflineGenerationError at /auth/login/
You have offline compression enabled but key "71f1bb91aa1db46c691a399635d662c7" is missing from offline manifest. You may need to run "python manage.py compress".

Solution
/opt/stack/horizon/openstack_dashboard/local
COMPRESS_OFFLINE=True --> False

Tuesday, 29 September 2015

Nagios python plugin

I used below plugin for creating easy services in Nagios. Main idea behind this without adding new commands for everycheck i just use same command for many service definition
check_command_big!find /var/ | grep test  |wc -l!5   . Here you can change only OS commands and check anything you want greater than 5 or any value you state. another example of check can be check_command_big!ps -ef | grep aprocess | wc -l !5



cat check_command_big.py

#!/usr/bin/python
#import sys, os, base64, getpass, socket, traceback, termios, tty, select
import paramiko, getpass
import os,sys,re
import signal


userName="user"
userPass="pass"
server=sys.argv[1]
command=sys.argv[2] 
maxcount=int(sys.argv[3])


t = paramiko.Transport((server,22))
try:
        t.connect(username=userName,password=userPass,hostkey=None)       
except:
        print server + ": Bad password or login!"
        t.close()
else:
        ch = t.open_channel(kind = "session")
        ch.exec_command(command)
        if (ch.recv_ready):
                x=int(ch.recv(1000)) 
                if x <= maxcount:
                        print "OK " + str(x) + " command=" + re.sub(r'\|', "",sys.argv[2]) + " | " +  str(x)
                        t.close()
                        sys.exit(0)
                else:
                        print "NOK " + str(x) + " command=" + re.sub(r'\|', "",sys.argv[2]) + " | " +  str(x)
                        t.close()
                        sys.exit(1)








define command{
        command_name    check_command_big
        command_line    $USER1$/check_command_big.py  $HOSTADDRESS$ '$ARG1$' $ARG2$
        }



define service{
        hostgroup_name                  testservers
        use                             generic-service
        check_interval                  10
        service_description             TEST
        check_command                   check_command_big!find /var/ | grep test  |wc -l!5
        }

Sunday, 27 September 2015

Cacti plugin installation

You need at least plugin achitecture, settings plugin. Here i used thold plugin for test.
Download plugin architecture cacti-plugin-0.8.7g-PA-v2.8.tar.gz
Download plugins settings-v0.7-1.tar.gz and thold-latest.tar.gz

# tar -zxvf settings-v0.7-1.tar.gz
# tar -zxvf cacti-plugin-0.8.7g-PA-v2.8.tar.gz
# tar -zxvf thold-latest.tar.gz
# cp -R /root/cacti-plugin-arch/files-0.8.7g/ /var/www/html/cacti/
# cp -R /root/settings /var/www/html/cacti/plugins
# cp -R /root/thold-0.41 /var/www/html/cacti/plugins


Under /root/cacti-plugin-arch
# mysql cacti -u root -p < pa.sql


edit /var/www/html/cacti/include/config.php and add lines below

/* load up old style plugins here */
$plugins = array();
//$plugins[] = 'thold';

/*
   Edit this to point to the default URL of your Cacti install
   ex: if your cacti install as at http://serverip/cacti/ this
   would be set to /cacti/
*/
$url_path = "/cacti/";


User Management enable plugin management
Plugin management enable plugins
User Management configure view and configure settings again.

Friday, 2 September 2011

check_by_ssh Remote command execution failed

"Remote command execution failed: *************************************************************************** "

try -E option for fixing this problem for check_by_ssh

Monday, 1 August 2011

500 OOPS: cannot change directory

I got this error in Red Hat 5.5 vsftp; 500 OOPS: cannot change directory
For this just run command below
setsebool -P ftp_home_dir on

Monday, 11 July 2011

find the WWN of a disk/LUN on Red Hat Enterprise Linux 5

find the WWN of a disk/LUN on Red Hat Enterprise Linux 5
# systool -c fc_host -v

Tuesday, 21 September 2010

Clone and Split 2G Virtualbox disk

In Virtual Box Media Manager release and remove disk this is important.
Run command below. Give full path, if not it will create disk in your home folder .
VBoxManage clonehd /media/VirtualBox/xpDomain/xpDomain.vdi /media/VirtualBox/xpDomain/xpSplited.vdi --format VMDK --variant Split2G

Wednesday, 28 July 2010

GPG error Synaptic Package Manager

For error
W: GPG error: http://download.virtualbox.org lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54422A4B98AB5139

run this command
# sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 54422A4B98AB5139

Tuesday, 15 June 2010

ssh initial connection slow

Check /etc/resolv.conf file and verify dns is working for the remote server.

Thursday, 20 May 2010

Citrix Client in Linux

Download and install package
http://www.citrix.com/English/ss/downloads/details.asp?downloadId=3323&productId=186&c1=sot2755&c2=ost1349860#top

Opening from web page
1. For the .mailcap file modification, in $HOME, create or modify the .mailcap file and add the line:
application/x-ica; /usr/lib/ICAClient/wfica.sh %s; x-mozilla-flags=plugin:Citrix ICA
2. For the MIME file modification, in $HOME, create or modify the .mime.types file and add the line:
application/x-ica ica


For ssl error

$ sudo cp /usr/share/ca-certificates/mozilla/GlobalSign_Root_CA.crt /usr/lib/ICAClient/keystore/cacerts/

Now you can use citrix client.

Tuesday, 27 April 2010

Put Close/Maximize/Minimize Buttons on the Left in Ubuntu

Ubuntu 10.04 buttons are on the right side. I move them to right
Alt+F2
Go apps \ metacity \ general
You will see button_layout
change order
close,maximize,minimize:
to
:minimize,maximize,close

Tuesday, 23 February 2010

Mysql reset root password

# /etc/init.d/mysqld stop
# mysqld_safe --skip-grant-tables &
# mysql -u root

mysql> use mysql;
mysql> update user set password=PASSWORD("yournewpasswordhere") where User='root';
mysql> flush privileges;
mysql> quit

# /etc/init.d/mysqld stop
# /etc/init.d/mysqld start

Now you can login with your new password
# mysql -u root -p

Monday, 22 February 2010

Ubuntu set week start to monday

locale | grep LC_TIME
LC_TIME=en_US.UTF-8
cd /usr/share/i18n/locales
sudo cp en_US en_US_custom
sudo gedit en_US_custom
first_weekday 1 --> 2
sudo gedit /etc/environment
LC_TIME="en_US_custom.UTF-8"

Thursday, 18 February 2010

Linux Remove file start with special character

Delte file name --help or -help

rm ./--help
rm -- --help

Linux Remove file start with special character

Delte file name --help or -help

rm ./--help
rm -- --help

Friday, 12 February 2010

Ubuntu installing same packages to another ubuntu

I want to prepare test OS for my ubuntu. Before appyling patches or new software I do testing on that machine (running on virtualbox)
MachineA $ dpkg --get-selections > mypackages.txt

MachineB $ sudo dpkg --set-selections < mypackages.txt
MachineB $ sudo apt-get dselect-upgrade

Saturday, 30 January 2010

nagios create readonly user

# cd /etc/nagios/

htpasswd passowrdfile readonlyuser
# htpasswd htpasswd.users nagiosuser

Enter you password.

Then edit cgi.cfg file.There are different access you can enable.
# SYSTEM/PROCESS INFORMATION ACCESS
# CONFIGURATION INFORMATION ACCESS
# SYSTEM/PROCESS COMMAND ACCESS
# GLOBAL HOST/SERVICE VIEW ACCESS
# GLOBAL HOST/SERVICE COMMAND ACCESS

"GLOBAL HOST/SERVICE VIEW ACCESS" access is enough for read only users.
authorized_for_all_services=nagiosadmin,nagiosuser
authorized_for_all_hosts=nagiosadmin,nagiosuser

Friday, 29 January 2010

Moving Ubuntu in Company

M$ Windows OS is only supported OS in my company. But I decided to move linux, because i am administrating around 180 Linux bases machine. These are tools which used before and afer .

M$ Office 2007 --> Installed Crossover Linux and M$ Office 2007
M$ Office Communicator --> Pidgin with Office communicator plug in
Windows share --> samba smb://domain;username@host/share and add "connect to a server" applet to panel.
Remote Desktop --> Terminal Server Client
Securcrt --> ssh in console itself with ssh key and clusterssh
wireless --> Also wireless is ok with dynamic wep protected eap with ca certificate and mschapv2 authentication.
internet explorer --> firefox and google chrome
babylon dictionary --> stardict
backup --> ddrescue and rsync for individual folders
gtalk --> cntlm and pidgin
vpn --> kvpnc
itunes --> gtkpod and rhythmbox

Monday, 25 January 2010

Pidgin ntlmaps gtalk behind isa proxy

I need to connect gtalk. Because support team of vendor companies using gtalk.
Nntlmaps; proxy software that allows you to authenticate via an MS Proxy Server

Install ntlmaps
# sudo apt-get install ntlmaps

configure ntlmaps
# vi /etc/ntlmaps/server.cfg

PARENT_PROXY: your isa proxy ip adress
PARENT_PROXY_PORT: you isa proxy port
NT_DOMAIN: domainname
USER: nt username
PASSWORD: nt password
LISTEN_PORT:5865 (ntlmaps listen port)

Pidgin --> accounts --> manage accounts --> modify --> advanced
check force old ssl clear others
connect port: 443
connect server: talk.google.com

In proxy tab
Proxy type: http
Host: 127.0.0.1
Port: 5865 (ntlmaps port)
Username: nt username
password : nt password