Wednesday, February 27, 2013

unregistered depot, No (i)nsert permission on host + HP UX

Hi Friends,

faced an error while installation of a depot or software in HP UX, i.e. shown below. It was to register the depot. with "swreg" command. Tried the same but couldn't understand it. or couldn't dig into it more.
but it got resolved in first troubleshooting step only. i.e. with restarting the swagent daemon.
after which installation successfully completed.

** and yes one more thing ONC plus makes changes at kernle level so requires a reboot of the server so please plan accordingly.

ERROR:   Access denied to root@ to start agent on
         unregistered depot
         "/tmp/HP-UX_11i_v3_version_B.11.31.15_ONCplus_B.11.31.15.depot".
         No (i)nsert permission on host.   IST
       * Agent pid=19839 completed.   IST
       * Started install agent on "/" for root@,
         pid=19846, 02/27/13 21:46:31 IST
ERROR:   Access denied to root@ to start agent on
         unregistered depot
         "/tmp/HP-UX_11i_v3_version_B.11.31.15_ONCplus_B.11.31.15.depot".
         No (i)nsert permission on host.    IST
       * Agent pid=19846 completed.   IST
ERROR:   Access denied to root@ to register soc.  No
         (i)nsert permission on host.  IST
#
#
#
# /sbin/init.d/swagentd stop
The swagentd daemon is stopped.
# /sbin/init.d/swagentd start
#


this restart of daemon of swagent works and installation started.


Love Sharing
Amit Chopra

 

Sunday, February 24, 2013

Creating WebApache server in 2 minutes + RHEL

Hi Friends,

Thanks and appreciate your each and every visit. Creating webapache server is very easy.

1. Create a yum repo file, for installation of httpd. for creating yum repo please visit beow link.

http://manywaystosuccess.blogspot.in/2012/09/yum-repository-on-rhel.html

2. yum install httpd

3. after installation, please check the status

[root@guitar named]# yum install httpd or  (rpm -qa |grep -i httpd)
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Package httpd-2.2.15-15.el6_2.1.x86_64 already installed and latest version
Nothing to do
[root@guitar named]#
[root@guitar named]# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 1.2.3.12 for ServerName
                                                           [  OK  ]
[root@guitar named]#
4. now comment the conetnt of belor file.

[root@guitar html]# cat /etc/httpd/conf.d/welcome.conf
#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
##
#    Options -Indexes
#    ErrorDocument 403 /error/noindex.html
#

[root@guitar html]#
[root@guitar html]#

5. Now create a file with any name in /var/www/html like below

[root@guitar html]# pwd
/var/www/html
[root@guitar html]# ls -ltr
total 4
-rw-r--r--. 1 root root 34 Feb 24 03:31 amit
[root@guitar html]# cat amit
Hi Friends,
welcome to my page.
[root@guitar html]#
6. Now restart the services of httpd:-

[root@guitar html]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 1.2.3.12 for ServerName
                                                           [  OK  ]
[root@guitar html]#
7. now from your internet explorer, you can type your server/system IP, and can check the content which you have written.



8. By default, the http page will appear like this, which means that httpd services are running. just read the page. it is written there that we have to comment the welcome page lines and write some content in /var/www/html/ directory.




Love Sharing
Amit Chopra
 

Error: Cannot retrieve repository metadata (repomd.xml) for repository: InstallMedia.+ RHEL

Hi Friends,

A quick solution for below error :-

while removing or installing through yum

---> Package rgmanager.x86_64 0:3.0.12.1-12.el6 will be erased
--> Finished Dependency Resolution
Error: Cannot retrieve repository metadata (repomd.xml) for repository: InstallMedia. Please verify its path and try again
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[root@guitar /]#
[root@guitar /]# cd /etc/yum.repos.d/
[root@guitar yum.repos.d]# ls -ltr
total 12
-rw-r--r--. 1 root root 529 May 30  2012 rhel-source.repo.bkp
-r--r--r--. 1 root root 114 Jun 14  2012 packagekit-media.repo
-rw-r--r--. 1 root root  76 Feb 24 01:05 yum.repo
[root@guitar yum.repos.d]# mv packagekit-media.repo packagekit-media.repo.bkp
[root@guitar yum.repos.d]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Cleaning repos: Installer
Cleaning up Everything
[root@guitar yum.repos.d]#
[root@guitar yum.repos.d]#
[root@guitar yum.repos.d]# yum update .

I was removing some packages, so the same got resolved and packages got removed.

--> Processing Dependency: /usr/sbin/rpc.mountd for package: resource-agents-3.9.2-12.el6.x86_64
--> Processing Dependency: /sbin/mount.nfs4 for package: resource-agents-3.9.2-12.el6.x86_64
--> Processing Dependency: /sbin/mount.nfs for package: resource-agents-3.9.2-12.el6.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package resource-agents.x86_64 0:3.9.2-12.el6 will be erased
--> Processing Dependency: resource-agents >= 3.9.1-1 for package: rgmanager-3.0.12.1-12.el6.x86_64
--> Running transaction check
---> Package rgmanager.x86_64 0:3.0.12.1-12.el6 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
 Package                    Arch     Version                 Repository                                                 Size
=============================================================================================================================
Removing:
 PackageKit-device-rebind   x86_64   0.5.8-20.el6            @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3   231 k
 bind                       x86_64   32:9.8.2-0.10.rc1.el6   @Installer                                                7.2 M
 bind-chroot                x86_64   32:9.8.2-0.10.rc1.el6   @Installer                                                0.0
 bind-dyndb-ldap            x86_64   1.1.0-0.9.b1.el6        @Installer                                                158 k
 bind-libs                  x86_64   32:9.8.2-0.10.rc1.el6   @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3   2.2 M
 bind-utils                 x86_64   32:9.8.2-0.10.rc1.el6   @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3   438 k
 rpcbind                    x86_64   0.2.0-9.el6             @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3    95 k
 samba-winbind              x86_64   3.5.10-125.el6          @Installer                                                 12 M
 samba-winbind-clients      x86_64   3.5.10-125.el6          @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3   3.4 M
 ypbind                     x86_64   3:1.20.4-29.el6         @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3    91 k
Removing for dependencies:
 gnome-packagekit           x86_64   2.28.3-3.el6            @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3   7.9 M
 gnome-vfs2-smb             x86_64   2.24.2-6.el6            @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3    32 k
 gvfs-smb                   x86_64   1.4.3-12.el6            @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3   302 k
 ipa-client                 x86_64   2.2.0-16.el6            @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3   239 k
 kdeartwork-screensavers    x86_64   4.3.4-7.el6             @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3   788 k
 kdebase                    x86_64   6:4.3.4-5.el6           @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3    12 M
 kdebase-runtime            x86_64   4.3.4-9.el6             @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3    13 M
 kdebase-runtime-libs       x86_64   4.3.4-9.el6             @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3   4.4 M
 kdebase-workspace          x86_64   4.3.4-23.el6            @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3    26 M
 kdebase-workspace-libs     x86_64   4.3.4-23.el6            @anaconda-RedHatEnterpri

Love Sharing
Amit Chopra


 

Saturday, February 23, 2013

syslogd: the kernel messages are already disabled + HP UX

Hi Friends,

We were getting error in starting syslogd. we tried to restart the syslog daemon. but that was not getting started. it was giving below or message in syslog.


# cat /var/adm/syslog/syslog.log

18:24:19 syslogd: restart

18:24:19 syslogd: the kernel messages are already disabled: No such device or address

20:40:58 syslogd: restart

we tried every possibility of restarting services, checking kernel value, even it was said to update with a patch.
At last we checked, the value of mail.log, which was more than 1.5 GB or more than the value which was configured. triming of the same brought us to the solution.


# pwd
/var/adm/syslog
# ls -ltr
total 4195152
-r--r--r--   1 root       root       2147483648 Feb  4 17:20 mail.log
-rw-------   1 root       sys         407792 Feb 19 20:08 core
-rw-r--r--   1 root       sys            154 Feb 19 23:33 OLDsyslog.log
-rw-r--r--   1 root       sys            201 Feb 20 20:40 syslog.log
# > mail.log
# ls -ltr
total 832
-rw-------   1 root       sys         407792 Feb 19 20:08 core
-rw-r--r--   1 root       sys            154 Feb 19 23:33 OLDsyslog.log
-rw-r--r--   1 root       sys            201 Feb 20 20:40 syslog.log
-r--r--r--   1 root       root             0 Feb 21 16:30 mail.log
# /sbin/init.d/syslogd stop
syslogd stopped
# /sbin/init.d/syslogd start
System message logger started
#
# /usr/sbin/syslogd -D
Syslogd: Already running.
#
# ps -ef |grep -i syslog
    root  1367     1  0 16:30:22 ?         0:00 /usr/sbin/syslogd -D
    root  1388 28259  0 16:30:40 pts/0     0:00 grep -i syslog
#


Love Sharing
Amit Chopra

ERROR in DNS configuration

Hi Friends,

Trying to configure DNS server. but getting below error :-

Name of My machine is :- guitar


Feb 23 18:02:51 guitar named: zone localhost.localdomain/IN: loaded serial 0
Feb 23 18:02:51 guitar named: zone localhost/IN: loaded serial 0
Feb 23 18:02:51 guitar named: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial
 0
Feb 23 18:02:51 guitar named: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Feb 23 18:02:51 guitar named: zone 0.in-addr.arpa/IN: loaded serial 0
Feb 23 18:02:51 guitar named: rhelfamily.com:9: unknown RR type 'guitar.rhelfamily.com'
Feb 23 18:02:51 guitar named: zone rhelfamily.com/IN: loading from master file rhelfamily.com failed: unknown class/type
Feb 23 18:02:51 guitar named: zone rhelfamily.com/IN: not loaded due to errors.
Feb 23 18:02:51 guitar named: _default/rhelfamily.com/IN: unknown class/type
[root@guitar named]# cat rhelfamily.com
$TTL 60
@       IN SOA  rhelfamily.com  dns-admin.rhelfamily.com. (
                                        201302  ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
@       IN      guitar.rhelfamily.com
guitar  IN      A       1.2.3.12
[root@guitar named]#

all suggestions invited

Love Sharing
Amit Chopra

Tuesday, February 19, 2013

Kabir Das ji ki vani

Hi Friends,

Kabir Das ji kehte hain k, Jeete ji marne ka abhyaas karne wale log maya mein rehte huwe nirlipt rehtein hain aur wo sada k liye aava gaman k chakra se mukt ho jatein hain..

According to Kabir Das  :- Those people who learn to live with all difficulties and without being materialistic. and while remaining in this world, they donot get in to this world. They will/can easily and happily leave this world. they will not get into this life CHAKRA again and again.

KABIR DAS JI K DOHE :-

Jeevat mare mare fooni jeeve aise sun samaiye,
            anjan maahi niranjan rahiye bahudi na bhavjal paaiye.....

Mariye to mar jaiye, foot pade sansaar.
             Aisa marna ko mare, din mein sau sau baar.....

==============================================

Muiaa jeetu ghari jaaiye titu jeevdiaa maru maari.

Marne te jagtu dare, jiviya lode sab koi.
            gurparsadi jeevat mare hukum bujhe soi.
Nanak aisi marni jo mare ta sad jeevan hoi...

Jeevat mare mare fooni jeeve ta mokhantar paave....

==============================================


All kinds of feedbacks and corrections are invited.

Thanks and love Sharing
Amit Chopra






 

Saturday, February 16, 2013

How to resolve Gateway Network error + HP UX

Hi Friends,

It is regarding one of the issue of Network, which we faced some days back. It was a kind of work through only. studying and reading more on it to check the exact cause. Firstly would like to tell, what we were able to do from server side and from Outside of the LAN/ same LAN.

1. We were able to connect Gateway or other sam LAN server from the server.
2. We were able to connect that server locally.

What we were not able of is :-

1. we were not able to connect to the server from different LAN.
2. Packet were dropping at Gateway only.
3. Gateway was not blocked from Security Team.
4. the trace was dropping at Gateway.

We checked /var/adm/syslogs/syslogs.log

the errors were like below :-

ipmon[830]: 13:28:58.460000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN
 13:29:10  ipmon[830]: 13:29:10.350000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN
 13:29:14  ipmon[830]: 13:29:13.820000 2x lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN
 13:29:16  ipmon[830]: 13:29:16.530000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN
 13:29:20  ipmon[830]: 13:29:20.460000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN
 13:29:22  ipmon[830]: 13:29:21.820000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN
 13:29:28  ipmon[830]: 13:29:28.460000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN
 13:29:28  ipmon[830]: 13:29:28.640000 lan1 @0:1 b 10.98.13.2 -> 224.0.0.1 PR igmp len 24 (32) IN
 13:29:35  ipmon[830]: 13:29:35.810000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 576  IN
 13:29:37  ipmon[830]: 13:29:37.830000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN
 13:29:38  ipmon[830]: 13:29:38.780000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 576  IN
 13:29:42  ipmon[830]: 13:29:42.080000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 576  IN
 13:29:45  ipmon[830]: 13:29:44.470000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN
 13:29:47  ipmon[830]: 13:29:46.560000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN
 13:29:51  ipmon[830]: 13:29:50.460000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN
 13:29:59  ipmon[830]: 13:29:58.460000 lan1 @0:6 b 0.0.0.0,68 -> 255.255.255.255,67 PR udp len 20 288  IN


This was due to IP file, which was stopping the server to get connected from outside or anywhere. the location of ipfile is

# cd /etc/opt/ipf
# pwd
/etc/opt/ipf
# ls -ltr
total 32
-rw-r--r--   1 root       sys              0 Jan 28 15:37 ipnat.conf
-rw-r--r--   1 root       sys              0 Jan 28 15:37 ipf6.conf
dr-xr-xr-x   2 bin        bin             96 Jan 28 15:37 rpc.ipf
-rw-r--r--   1 root       sys           4875 Jan 28 16:49 ipf.conf.bkp
-rw-------   1 root       root             3 Feb 11 18:10 ipmon.pid.bkp
-rw-r--r--   1 root       sys              4895  13:36 ipf.conf
# cat ipf.conf
#

Now please read ipf.conf file and also take the backup of the configuration files. in IP CONF files,

allow every line, and block the last line or comment the last line of ipf.conf file

# grep -v "^#" ipf.conf
block in log quick all with ipopts

 # These rules will allow connections initiated from
 # this host along with the return connection
 pass out quick proto icmp all keep state
 pass out quick proto tcp all keep state
 pass out quick proto udp all keep state
 # End allow outgoing rules
 ####################################################
 # These rules specifically do not log netbios udp or portmapper
 # packets because these protocols tends to be very noisy on networks
 block in quick proto udp from any to any port = netbios_ns
 block in quick proto udp from any to any port = netbios_dgm
 block in quick proto udp from any to any port = portmap


 pass in quick proto tcp from any        to any port = 2367  flags S keep state keep frags
pass in quick proto tcp from any            to any port = 5308   flags S keep state keep frags
 pass in quick proto udp from any            to any port = tftp
pass in quick proto tcp from any            to any port = 22     flags S keep state keep frags

 pass in quick proto udp from any            to any port = snmp-trap  keep state
 pass in quick proto tcp from any            to any port = 1188   flags S keep state keep frags
 pass in quick proto tcp from any          to any port = 1110   flags S keep state keep frags
 pass in quick proto icmp from any            to any icmp-type 8
 pass in quick proto tcp from any            to any port = 5989 flags S keep state keep frags
 pass in quick proto tcp from any        to any port = hpidsagent flags S keep state keep frags
 pass in quick proto udp from any            to any port = domain     keep state
 pass in quick proto udp from any            to any port = snmp       keep state
 pass in quick proto tcp from any        to any port = hpidsadmin flags S keep state keep frags
 pass in quick proto tcp from any to any port = domain flags S keep state keep frags
#
-----

this has to be commented.

#Block any incoming connections which were not explicitly allowed
#block in log all
#
Now restart the services of ipfboot,

# /sbin/init.d/ipfboot restart
Usage: /sbin/init.d/ipfboot (start|stop)
#  /sbin/init.d/ipfboot stop
# /sbin/init.d/ipfboot start
Set 0 now inactive
Set 0 now inactive
0 entries flushed from NAT table
0 entries flushed from NAT list
#
#
after this change my server was able to be ping from outside. and the server was also connecting from other LANs/ different LANs.

This resolved our issue. but this may not be the exact resolution or root cause, so please reading more about it and if find more on it. please add the same here as database. :)
I may be wrong above if yes then please comment and correct me or guide me.

Love Sharing
Amit Chopra


 

Thursday, February 14, 2013

Learning For Me

It is not that how many aims you have,
             It is that how you many alternatives you find to attain them.
It is not that How much you struggles,
             It is that how many directions you give to your struggles.
It is not me thing who lone has to be grown,
             It is the us thing in yourself made to be grown together.
It is not you are learning how many things,
            It is how you are using your learnings.



Love Sharing
Amit Chopra

Wednesday, February 13, 2013

Script/Code for df output in GB + RHEL linux

Hi Friends,

The same we did for BDF in HPUX, we can use df -khl in Linux. this can save and send through mail.

echo "**************" > /tmp/resource.csv
echo "Resource Utilization and Uptime" >> /tmp/resource.csv
echo "**************" >> /tmp/resource.csv
echo "Total Space allocated in GB" >> /tmp/resource.csv
df -khlT | awk '{if(NF==1){l=$0;getline;sub(" *"," ");print l$0}else print}' |awk '{print $3/1048576 }' | awk '{sum += $1} END {print sum}' >> /tmp/resource.csv
echo "Total Space Used in GB" >> /tmp/resource.csv
df -khlT | awk '{if(NF==1){l=$0;getline;sub(" *"," ");print l$0}else print}' |awk '{print $4/1048576 }' | awk '{sum += $1} END {print sum}' >> /tmp/resource.csv
echo "uptime report " >> /tmp/resource.csv
uptime >> /tmp/resource.csv

later you can use this .csv file as a o/p using mailx/mutt or sendmail

Love Sharing
Amit Chopra

What is the difference between PA-RISC and ITANIUM boot sequence HP UX

Difference between PARISC and Integrity Boot Sequence

Adding to my knowledge. Learning taken from HP and google..
 
Boot Overview for Cell-Base HP 9000 Servers. Cell-based HP 9000 servers have PA-RISC processors and have the following boot process
1. PDC Self Test
2. PDC Boot
3. Boot Console Handler (BCH, a menu-driven boot environment)
4. Initial System Loader (ISL)
5. Secondary System Loader (hpux)
6. HP-UX Operating System

1. Processor Abstraction Layer (PAL)
2. System Abstraction Layer (SAL)
3. Extensible Firmware Interface (EFI)
4. EFI Boot Manager (menu-driven boot environment)
 
a. EFI Shell (command-driven boot environment)
b. EFI Scripts and Applications
EFI scripts and EFI applications can be initiated from either EFI Boot Manager or EFI Shell.
5. Operating System Loader
 
The following OS loaders are supported on HP Integrity servers. OS loaders can be initiated from the EFI Boot Manger or the EFI Shell.
 
 
a. HPUX.EFI Loader
Loader for the HP-UX operating system.
b. ELILO.EFI Loader
Loader for Red Hat Enterprise Linux or SuSE Linux Enterprise Server.
c. vms_loader.efi Loader
Loader for HP OpenVMS I64.
d. ia64ldr.efi Loader
Loader for Microsoft Windows Server 2003. ia64ldr.efi must be initiated from EFI Boot Manager (not from the EFI Shell).

Tuesday, February 12, 2013

Script to add and mail bdf output in GB in excel frmt HP UX

Hi Friends,

Sometimes, we need o/p of BDF from our servers with below specification :-

1. We want to add o/p of BDF and then send the output to an excel sheet through mail.
2. Adding the allocated and used space is a requirement to check resource utilization measuremnet.
3. BDF o/p calculation with (output in GB) and adding the o/p as well and then seding through mail in excel format.
4. To avoid lengthy process of logging into each servers and doing all maths, will consume lot and lot of time. if servers are more then we may need to give number of days or assign a particular guy of looking into this.
5. this script can be modified on the basis of requiremnent.
6. so with the help of google friend, and some twist. Below script into existence. LOL.

SCRIPT for BDF o/p on mail in GB in excel format.......

#!/bin/sh
echo "**************" > /tmp/resource.csv
echo "Resource Utilization and Uptime" >> /tmp/resource.csv
echo "**************" >> /tmp/resource.csv
echo "Total Space allocated in GB" >> /tmp/resource.csv
bdf -l | awk '{if(NF==1){l=$0;getline;sub(" *"," ");print l$0}else print}' |awk '{print $2/1048576 }' | awk '{sum += $1} END {print sum}' >> /tmp/resource.csv
echo "Total Space Used in GB" >> /tmp/resource.csv
bdf -l | awk '{if(NF==1){l=$0;getline;sub(" *"," ");print l$0}else print}' |awk '{print $3/1048576 }' | awk '{sum += $1} END {print sum}' >> /tmp/resource.csv
echo "uptime report " >> /tmp/resource.csv
uptime >> /tmp/resource.csv
/usr/bin/uuencode /tmp/resource.csv /tmp/resource.csv |mailx -m -s " Resource utilization and Uptime Report" xyz@xyz.com

What above script is doing :-

a. echoing thing is just to give information about what command will provide.
b. bdf output is followed with awk to select only allocated and used column of bdf o/p. using separate line for both need.
c. resource.csv will generate the file in excel format.
d. awk '{if(NF==1){l=$0;getline;sub(" *"," ");print l$0}else print}' :- this is being used to print the o/p in a line so that confusion by command of space and blank line can be avoided.
e.  print $2/1048576 :- this is being done to convert value into GB.
f. ">> " sign is appending the o/p value in every command and cascading.
g. uuencode is being used to attach file and mailx is for sending mail on any email ID.
h. uuencode and mailx combination is being used to have attachment from server itself.


will add more into it.

Thanks for every visit
Love All and Love Sharing
Amit Chopra

Thursday, February 7, 2013

How to send mail with an atttachment HP UX

Hi Friends,

Thanks for those good friends working on HP UX forum or many other forums, I learnt how to send an email with an attachment from HP UX due to them only. I stuck a bit in starting but found in 4th or 5th search.The attachment can be obtained in the same format. I tried to have attachment of the form gunzip.Below is an example.

an example:- if you an attachment of .gzip format on HP UX. like


#pwd
/tmp
#ls
myname.gzip
#

then to send this file through mailx or sendmail

#/usr/bin/uuencode myname.gzip myname.gzip |mailx xyz@xyz.com or anydomain.com

or

#/usr/bin/uuencode myname.gzip myname.gzip |mailx -m " Filename or urdesiredname" xyz@xyyz.com

this showed a different result, it sent message to filname, to or and to urdesiredname also @ server domainname.com"

to me it showed some text message or warning in output for saving message in ded.letter. that i donot know now. will check and learn more on it. Will learn or read more on it.

* for any domain if firewall allows.

Then through mail, I obtained the myname.gzip file.

yes UUENCODE, we can get the attachment in different format. for the same we can consult manuals.
Thanks a lot HP forums to make knowledge available for all.



Love Sharing
Amit Chopra


 

Tuesday, February 5, 2013

Interview Questions for HP UX part 2

Hi Friends,

Thanks and appreciate your visits, Woul like to share some interview questions on HP UX....

1. What do you understand about APA, i.e. Auto Port aggregation?
2. How do you create APA and what is the use of the same?
3. What is the command to check port of a running service?
4. What is the file, which is required to tell system to look into it before looking into DNS, NIS, etc.
5. How can you set the network address and gateway in HP UX ? and does this require any reboot of he system?
6. How can we set hostname of the server, and does it require any reboot of machine?
7. How can we block root user login ?
The change is to be done in /etc/opt/ssh/sshd_config
Permit rootlogin=no

# /sbin/init.d/secsh stop
#/sbin/init.d/secsh start

 Done.

8. what are the use of /etc/netconfig file, /etc/rc.config.d/netconf and /etc/rc.config.d/nddconf  files?
9. SAUTIL can be used to retrieve RAID configuration, information of controller, logical drives, RAID driver information (STATS also). and recreating controller device files.
10. A simple question, :) i.e. how we can use calculator in HP UX or any UNIX.?

# bc -l
26251*64+26251*64+2187*64+8709*32+2187*64+4374*64
4198688
4198688/1024
4100.28125000000000000000
quit
# bc -l
1745879040
1745879040
1745879040/1024/1024
1665.00000000000000000000
quit
Please add your comments and feedbacks, so that improvement and new ideas can come with your knowledge.


Love Sharing
Amit Chopra

Change is Life

Hi Friends,

I donot know what is the meaning of this life or what we are living for. But What I can say is change is the way and only way, with which we can learn living.
Be an open minded and accept all kind of feedbacks, either good or bad.


LOvE ShAriNg
Amit Chopra

Sunday, February 3, 2013

how to do SSH-KEYGEN RHEL and HP UX

Hi Friends,

A new thing i have learnt today, which is in RHEL. It is to generate ssh-keygen. Which we used to do passowrd less authentication. here what happens at backend, the file authorized_keys in local dir of user in .ssh/authorized_keys. it copies the encrypted password of a user into another server.
It requires only one time passsword and after this a user doesn;t need a passowrd to login into the server with which encrypted file is shared.

# or $ or any user can generate ssh-keygen

#ssh-keygen -t rsa

it will generate a key for root user as i am on root.

now a quick way to sent the file to another node is in LINUX.

#ssh-copy-id node1 ;------------ it is being done from node2 for example.

enter the password for once and then it will login and then exit and then login.

Now you will not need to enter the passsword.


HP UX :-

ofcourse, Yes User has to be there eg. sanjay

$ ssh sanjay@node1 mkdir -p .ssh

The authenticity of host 'node1 (node1)' can't be established.

RSA key fingerprint is fd:a0:7d:04:e7:ee:b1:d5:7a:fd:31:34:d9:0c:b3:89.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'node1' (RSA) to the list of known hosts.

Password:

$

$ cat .ssh/id_rsa.pub|ssh sanjay@node1 'cat >> .ssh/authorized_keys'

Password:

$

$

$

$


Last successful login:       Tue Aug 23 19:05:27 2011 10.2.5.16

(c)Copyright 1983-2006 Hewlett-Packard Development Company, L.P.

(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California

(c)Copyright 1980, 1984, 1986 Novell, Inc.

(c)Copyright 1986-2000 Sun Microsystems, Inc.

(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology

(c)Copyright 1989-1993  The Open Software Foundation, Inc.

(c)Copyright 1990 Motorola, Inc.

(c)Copyright 1990, 1991, 1992 Cornell University

(c)Copyright 1989-1991 The University of Maryland

(c)Copyright 1988 Carnegie Mellon University

(c)Copyright 1991-2006 Mentat Inc.

(c)Copyright 1996 Morning Star Technologies, Inc.

(c)Copyright 1996 Progressive Systems, Inc.

 
Now you are done.
Love Sharing
Amit Chopra
 

Question on SWAP?

Hi Friends,

I have one query that is,

Why is it mandatory to create SWAP file system in RHEL or HP UX or any OS system? If Yes then why and if no then Why?

1. Points, if we taken large number of RAM or LARGE memory then?
2. Depend upon application requirement?
3. Depend on Hardware config?
4. What are the other things?


Love Sharing
Amit Chopra

 

YUM USING HTTP or APACHE

Hi Freinds,


For using http or apache for yum installation, please go through below link. each and every step is explained.

http://manywaystosuccess.blogspot.in/2013/02/how-to-create-yum-server-and-client-rhel.html


Thanks a lot for the visit.

Love sharing
Amit Chopra





 

How to Create Yum Server and client RHEL

Hi Friends,

Somedays back, we were learning and sharing yum.repo creation. did some more learning and test. we learn to make yum server also with clients. Good thing is that we are running client with HTTP. this configuration i have learnt and used first time. it is great.

1. What we should have for this :-

  a. One Linux machine, where we will be creating a yum server.
  b. HTTP needs to be installed with dependant files on YUM server. thats it.
  c. Yes, very important is. that server and clients should be in same LAN.
  c.  one or more number of clients with the same type of client configuration in /etc/yum.repos.d/yum.repo

above yum.repo is the file name given by us.

thats it, after this, we can run yum clean all and yum update all from the # prompt or using sudo or root privilege.


YUM SERVER Side configuration given below

for basic yum.repo config please follow below link.


After this when you have installed http packages. then  you will be able to see below mentioned directory.

#cd  /var/www/html/
#

If you are able to see below directory, now create another directory name as per your ease inside this directory.

like in my case i created directory named as Server in 5.8 RHEL.

[root@amit Server]# pwd
/var/www/html/Server
[root@amit Server]#
Below is my yum.repo in my server's /etc/yum.repos.d/ directory
After this, DVD is mounted on /var/www/html/Server/

using

#mount /dev/dvd /var/www/html/Server
#
as it is done, now edit yum.repo as below. This server IP is 1.2.3.5 i.e. YUM SERVER


[root@amit Server]# cat /etc/yum.repos.d/yum.repo
[Installer]
name=Installer
baseurl=file:///var/www/html/Server/Server
gpgcheck=0
enabled=1
[Amit]
name=Amit
baseurl=file:///var/www/html/Server/Cluster
gpgcheck=0
enabled=1
[Manager]
name=Manager
baseurl=file:///var/www/html/Server/ClusterStorage
gpgcheck=0
enabled=1
[Work]
name=Work
baseurl=file:///var/www/html/Server/VT
gpgcheck=0
enabled=1
[root@amit Server]#

after this restart the services of HTTPD using
#/etc/init.d/httpd restart

once done, you can chech configuration of your yum file also using

#yum clean all
#yum update all

Now the YUM CLIENT configuration is below :-

only edit  /etc/yum.repos.d/yum.repo file

#cat /etc/yum.repos.d/yum.repo
####1.2.3.5 is YUM SERVER####
[Installer]
name=Installer
baseurl=http://1.2.3.5/Server/Server
gpgcheck=0
enabled=1
[Amit]
name=Amit
baseurl=http://1.2.3.5/Server/Cluster
gpgcheck=0
enabled=1
[Manager]
name=Manager
baseurl=http://1.2.3.5/Server/ClusterStorage
gpgcheck=0
enabled=1
[Work]
name=Work
baseurl=http://1.2.3.5/Server/VT
gpgcheck=0
enabled=1
Thats It, use below commands now on client side.

#yum clean all
#yum update all

Now if every thing goeas well. now you can use :-

#yum install "name of the packgae " -y

it will install the package, taking a small example below of my client side installation.

[root@ ~]# yum install *gdm* -y
Loaded plugins: katello, product-id, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Package 1:gdm-2.16.0-59.el5.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gdm-docs.x86_64 1:2.16.0-59.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
 Package                     Arch                      Version                            Repository                    Size
=============================================================================================================================
Installing:
 gdm-docs                    x86_64                    1:2.16.0-59.el5                    Installer                    122 k
Transaction Summary
=============================================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)
Total download size: 122 k
Downloading Packages:
gdm-docs-2.16.0-59.el5.x86_64.rpm                                                                     | 122 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : gdm-docs                                                                                              1/1
Installed products updated.
Installed:
  gdm-docs.x86_64 1:2.16.0-59.el5
Complete!
[root@swati ~]#

##############

Done. Thanks a lot for the visit.

Love sharing
Amit Chopra




 

Mere Satguru Alakh lakhaya hai, Baba Bulleh Shah

Poetry of Baba Bulleh Shah....

This Poetry I found in book SAI BULLEH SHAH, by J.R. PURI and T.R. SHANGARI

Thanks for sharing so good with us.

Sai Bulleh Shah Kehnde ne.....



Paya Hai kich paya hai, mere satguru alakh lakhaya hai.

Kahu baer pada kahu beli hai, kahu Majnu kahu Laelli hai.

Kahu aap guru kahu cheli hai, sab apni rah dikhaya hai.

kahu masjid ka vartara hai, kahu banya Thakurdwara hai.

Kahu Beraagi japdhara hai, Kahu shekhan ban ban aaya hai.

kahu turak kitaba padte ho, kahu bhagat hindu jap karte ho.

kahu aur gufa mein padte ho, har ghar ghar ladd laddaya hai..

.............................................................................

Bulleh Shah ka main mohtaj hoaa,

Maharaj mile mera kaaj hoaa,

Darshan Piya da mera Ilaaj hoaa,

Aapi aap mein aap samaya hai,

Mere satguru alakh jagaya hai...




Thanks and Love Sharing
Amit Chopra



 

Ab Hum Gum Huye, Baba Sai Bulleh Shah

This is i am writing from a book, which is with me. My Daddy brought it to read. He reads it sometimes. I also like the poetry of Baba Bulleh Shah. Reading Sufism brings near a different world, when u fall into sufi songs, Poetry. Just close your eyes and feel God very near to you or inside you. calling you in every word of his.

Poetry of Baba Bulleh Shah....

This Poetry I found in book SAI BULLEH SHAH, by J.R. PURI and T.R. SHANGARI

Thanks for sharing so good with us.


Baba Bulleh shah kehnde ne :-


Ab hum gum huve, prem nagar k shahar.

Apne aap ko sodh raha hun, na sir haath na paer.

Khudi khoi apna cheetah, tab hoi gal khaer.

laththe dhagde pahile ghar thi, Kaun kare nirvaer.

Bulleh shahu hai dohi jahani, koi na disda gaer.

====================================

Sab saadh kaho, koi chor nahin,

har ghat vich aap samaya hai.

Tuk bhujh kaun chup aaya hai.




Love Sharing
Amit Chopra










 

Saturday, February 2, 2013

Managing Self

Where and How should the life should be started ?

 

Face in the Crowd


Staying shy didn't lead to anything,

Staying in fear didn't lead to anything,

Staying in proud will leave nothing,

Only Loving, Sharing and staying open minded will lead to live the life...

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

I don't know how to live life,

I don't know how to keep the smile,

I don't know how to remove I in me,

Only after giving smile on face of others, I started living...

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

People laugh on others, does they see their face inside,

People may don't know what they are following,

People may love this materialistic life,

But when I started loving my family, started praying wishes for others then I started loving...

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

I donot know the rhyme,

I donot know about my sunshine,

but i want to leave a sign when I leave this world.................

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


God Bless all of us,
Amit Chopra