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:
#!/usr/local/groundwork/perl/bin/perl
## Written 12/5/00 Jeremy Hanmer
# $Id: check_ftpget2.pl,v 1.1.1.1 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);
getopts("H:u:p:f: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") ||
&crit("connect");
$ftp->login("$username", "$pass") ||
&crit("login");
$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, 12 June 2012
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.
fuse-ntfs-3g
dkms-fuse
fuse-libs
reboot and done.
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.
fuse-ntfs-3g
dkms-fuse
fuse-libs
reboot and done.
Monday, 4 June 2012
Speed Up Network File System (NFS) File Access
for more details please refer
http://www.cyberciti.biz/faq/centos-redhat-install-configure-cachefilesd-for-nfs/
still not able to test it.but somehow its really can help me.
http://www.cyberciti.biz/faq/centos-redhat-install-configure-cachefilesd-for-nfs/
still not able to test it.but somehow its really can help me.
Subscribe to:
Posts (Atom)