Tuesday, 12 June 2012

Check_file with date for HP UX

today just able to get the solution for checking file for HP-UX.

Issue: I need to check file certain file everyday using GWOS and nagios as a base.
Becoz the hp-ux used perl scripting, so for me its really challenging.
If using bash scripting its should be no problem.

GWOS server = Redhat 5.6
Target = HP-UX server.
example file : /tmp/test_20120920.csv

create file end with .pl (for plugin)
example : vi check_ftpget.pl

add below details on GWOS server:

## Written 12/5/00 Jeremy Hanmer
# $Id: check_ftpget2.pl,v 2005/02/07 19:33:32 hmann Exp $
use POSIX qw/strftime/;
use strict;
use Net::FTP;
use Getopt::Std;

use vars qw($opt_H $opt_u $opt_p $opt_f $opt_date);

my $date = strftime "%Y%m%d", localtime;

my $host = $opt_H ||
    die "usage: check_ftp.pl -H host [<-u user> <-p pass> <-f file>]\n";

my $username = $opt_u || 'anonymous';
my $pass = $opt_p || "$ENV{'LOGNAME'}\@$ENV{'HOSTNAME'}" ;

my $file ="$opt_f$date.csv";

my $status = 0;
my $problem;
my $output = "ftp ok $file";

my $ftp = Net::FTP->new("$host") ||

$ftp->login("$username", "$pass") ||

$ftp->get($file) ||
    &crit("get") if $file;

sub crit()
    $problem = $_[0];
    $status = 2;
    if ( $problem eq 'connect' ) {
        $output = "can't connect";
    } elsif ( $problem eq 'login' ) {
        $output = "can't log in";
    } elsif ( $problem eq 'get' ) {
        $output = "cant get $file";

print "$output\n";
exit $status;


test the scripting at GWOS server.
check-ftpget3.pl -H XXXXX -u nagios2 -p XXXXXX-f /tmp/test_
ftp ok /tmp/test_20120612.csv

ok done..can sleep..hahahaha

Tuesday, 5 June 2012

Fatal : Module fuse Not found RHEL5

Yesterday i need to mount NTFS to my machine using RHEL 5.

After installed fuse-libs and fuse packages i still have that error.

"Fatal module fuse not found"

I also run modprobe fuse but still doesn't work.

finally, this is how i solved this issue.

you just need to download and install below packages.

reboot and done.

Sunday, 20 May 2012

RHEVM 3.0 : IPA configuration.


The log file for this installation can be found in /var/log/ipaserver-install.log
This program will set up the IPA Server.

This includes:
  * Configure a stand-alone CA (dogtag) for certificate management
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)

To accept the default shown in brackets, press the Enter key.

Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
Example: master.example.com.

Server host name [rhevm.demo.com]:

Warning: Hostname (rhevm.demo.com) not found in DNS
The domain name has been calculated based on the host name.

Please confirm the domain name [demo.com]:

The IPA Master Server will be configured with
Hostname:    rhevm.demo.com
IP address:
Domain name: demo.com

The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.

Please provide a realm name [DEMO.COM]:
Certain directory server operations require an administrative user.
This user is referred to as the Directory Manager and has full access
to the Directory for system management tasks and will be added to the
instance of directory server created for IPA.
The password must be at least 8 characters long.

Directory Manager password:
Password (confirm):

The IPA server requires an administrative user, named 'admin'.
This user is a regular system account used for IPA server administration.

IPA admin password:
Password (confirm):

The following operations may take some minutes to complete.
Please wait until the prompt is returned.

Configuring ntpd
  [1/4]: stopping ntpd
  [2/4]: writing configuration
  [3/4]: configuring ntpd to start on boot
  [4/4]: starting ntpd
done configuring ntpd.
Configuring directory server for the CA: Estimated time 30 minutes 30 seconds
  [1/3]: creating directory server user
  [2/3]: creating directory server instance
  [3/3]: restarting directory server
done configuring pkids.
Configuring certificate server: Estimated time 33 minutes 30 seconds
  [1/17]: creating certificate server user
  [2/17]: creating pki-ca instance
  [3/17]: configuring certificate server instance
  [4/17]: disabling nonces
  [5/17]: creating CA agent PKCS#12 file in /root
  [6/17]: creating RA agent certificate database
  [7/17]: importing CA chain to RA certificate database
  [8/17]: fixing RA database permissions
  [9/17]: setting up signing cert profile
  [10/17]: set up CRL publishing
  [11/17]: set certificate subject base
  [12/17]: configuring certificate server to start on boot
  [13/17]: restarting certificate server
  [14/17]: requesting RA certificate from CA
  [15/17]: issuing RA agent certificate
  [16/17]: adding RA agent as a trusted user
  [17/17]: Configure HTTP to proxy connections
done configuring pki-cad.
Configuring directory server: Estimated time 31 minutes
  [1/35]: creating directory server user
  [2/35]: creating directory server instance
  [3/35]: adding default schema
  [4/35]: enabling memberof plugin
  [5/35]: enabling referential integrity plugin
  [6/35]: enabling winsync plugin
  [7/35]: configuring replication version plugin
  [8/35]: enabling IPA enrollment plugin
  [9/35]: enabling ldapi
  [10/35]: configuring uniqueness plugin
  [11/35]: configuring uuid plugin
  [12/35]: configuring modrdn plugin
  [13/35]: enabling entryUSN plugin
  [14/35]: configuring lockout plugin
  [15/35]: creating indices
  [16/35]: configuring ssl for ds instance
  [17/35]: configuring certmap.conf
  [18/35]: configure autobind for root
  [19/35]: configure new location for managed entries
  [20/35]: restarting directory server
  [21/35]: adding default layout
  [22/35]: adding delegation layout
  [23/35]: adding replication acis
  [24/35]: creating container for managed entries
  [25/35]: configuring user private groups
  [26/35]: configuring netgroups from hostgroups
  [27/35]: creating default Sudo bind user
  [28/35]: creating default Auto Member layout
  [29/35]: creating default HBAC rule allow_all
  [30/35]: initializing group membership
  [31/35]: adding master entry
  [32/35]: configuring Posix uid/gid generation
  [33/35]: enabling compatibility plugin
Restarting IPA to initialize updates before performing deletes:
  [1/2]: stopping directory server
  [2/2]: starting directory server
done configuring dirsrv.
  [34/35]: tuning directory server
  [35/35]: configuring directory to start on boot
done configuring dirsrv.
Configuring Kerberos KDC: Estimated time 30 minutes 30 seconds
  [1/14]: setting KDC account password
  [2/14]: adding sasl mappings to the directory
  [3/14]: adding kerberos entries to the DS
  [4/14]: adding default ACIs
  [5/14]: configuring KDC
  [6/14]: adding default keytypes
  [7/14]: adding default password policy
  [8/14]: creating a keytab for the directory
  [9/14]: creating a keytab for the machine
  [10/14]: exporting the kadmin keytab
  [11/14]: adding the password extension to the directory
  [12/14]: adding the kerberos master key to the directory
  [13/14]: starting the KDC
  [14/14]: configuring KDC to start on boot
done configuring krb5kdc.
Configuring ipa_kpasswd
  [1/2]: starting ipa_kpasswd
  [2/2]: configuring ipa_kpasswd to start on boot
done configuring ipa_kpasswd.
Configuring the web interface: Estimated time 31 minutes
  [1/13]: disabling mod_ssl in httpd
  [2/13]: setting mod_nss port to 443
  [3/13]: setting mod_nss password file
  [4/13]: enabling mod_nss renegotiate
  [5/13]: adding URL rewriting rules
  [6/13]: configuring httpd
  [7/13]: setting up ssl
  [8/13]: setting up browser autoconfig
  [9/13]: publish CA cert
  [10/13]: creating a keytab for httpd
  [11/13]: configuring SELinux for httpd
  [12/13]: restarting httpd
  [13/13]: configuring httpd to start on boot
done configuring httpd.
Applying LDAP updates
Restarting IPA to initialize updates before performing deletes:
  [1/2]: stopping directory server
  [2/2]: starting directory server
done configuring dirsrv.
Restarting the directory server
Restarting the KDC
Restarting the web server
Sample zone file for bind has been created in /tmp/sample.zone.QqD246.db
Setup complete

Next steps:
        1. You must make sure these network ports are open:
                TCP Ports:
                  * 80, 443: HTTP/HTTPS
                  * 389, 636: LDAP/LDAPS
                  * 88, 464: kerberos
                UDP Ports:
                  * 88, 464: kerberos
                  * 123: ntp

        2. You can now obtain a kerberos ticket using the command: 'kinit admin'
           This ticket will allow you to use the IPA tools (e.g., ipa user-add)
           and the web user interface.

Be sure to back up the CA certificate stored in /root/cacert.p12
This file is required to create replicas. The password for this
file is the Directory Manager password

Friday, 11 May 2012

GWOS: Convert/Extract MIB to GroundWorks

Hi ,

So just follow below step, its worked for me.

Cd /usr/local/groundwork/tools/snmp_mibs
./convert_mib.sh file.mib

Add file.mib.conf to /usr/local/groundwork/common/etc/snmp/snmptt.ini

[root@xxxxxxxx# /etc/init.d/groundwork restart snmptt
/usr/local/groundwork/common/scripts/ctl-snmptt.sh : snmptt stopped
/usr/local/groundwork/common/scripts/ctl-snmptt.sh : snmptt started

for example:

cd /usr/local/groundwork/tools/snmp_mibs
./convert_mib.sh file.mib /tmp/filename.mib

*****  Processing MIB file *****

snmptranslate version: NET-SNMP version: 5.6
severity: Normal

File to load is:        /tmp/FORTINET-CORE-MIB.mib
File to APPEND TO:      ./FORTINET-CORE-MIB.mib.conf

MIBS environment var:   /tmp/FORTINET-CORE-MIB.mib

Processing MIB:         FORTINET-CORE-MIB
skipping a TRAP-TYPE / NOTIFICATION-TYPE line - probably an import line.
Line: 317
Variables: fnSysSerial sysName ifIndex
Enterprise: fnTrapsPrefix
Looking up via snmptranslate: FORTINET-CORE-MIB::fnTrapIpChange
OID: .
Line: 324
Variables: fnSysSerial sysName
Enterprise: fnTrapsPrefix
Looking up via snmptranslate: FORTINET-CORE-MIB::fnTrapTest
OID: .


Total translations:        8
Successful translations:   8
Failed translations:       0

*the mib.conf wil locate at

[root@txxxxx snmp_mibs]# ls
convert_mib.sh  FORTINET-CORE-MIB.mib.conf  upgrade_snmptt_confs.sh
[root@xxxx snmp_mibs]#

move the conf file to

[root@xxxxx snmp_mibs]# mv FORTINET-CORE-MIB.mib.conf /usr/local/groundwork/common/etc/snmp/

edit the /usr/local/groundwork/common/etc/snmp/snmptt.ini

add the file name


restart services
/etc/init.d/groundwork restart snmptt
/usr/local/groundwork/common/scripts/ctl-snmptt.sh : snmptt stopped
/usr/local/groundwork/common/scripts/ctl-snmptt.sh : snmptt started

for more details :

Wednesday, 9 May 2012

GWOS: Checking disk for HPUX

$USER1$/check_by_ssh -H $HOSTADDRESS$ -t 60 -l "$USER17$" -C "$USER22$/check_disk_hpux -w $ARG1$ -c $ARG2$ -p $ARG3$"

*maleh dh*

GWOS: checking SWAP_hpux

edit the plugin from previous post.

to something like

swapinfo | grep dev