Wednesday, August 31, 2011

Nagios - ERROR opening session: An empty privacy password was specified.

in Nagios® Core™ 3.2.3 i got this error when running checks with "check_snmp_load":
"ERROR opening session: An empty privacy password was specified."

on the command line, after executing this:
../libexec/snmp/check_snmp_load.pl -l readpriv -x xxxxxx -X xxxxxx -H hostname -w 3,3,2 -c 4,4,3 -T netsl

i got this:
Argument "v6.0.1" isn't numeric in numeric lt (<) at ./check_snmp_load.pl_old line 348.
Load : 0.00 0.00 0.00 : OK

I changed line 348 from:
my $resultat = (Net::SNMP->VERSION < 4) ?

 to:
my $resultat = (Net::SNMP->VERSION lt 4) ?


..works

Wednesday, August 17, 2011

automatically bring up the openvpn client

# /etc/rc.local
echo 0 > /proc/sys/net/ipv4/conf/tun0/rp_filter
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
echo 1 > /proc/sys/net/ipv4/ip_forward
/usr/local/sbin/openvpn --config /etc/openvpn/client.conf --daemon &

#i use this to do all kinds of stuff...

clearing a mail queue

for f in ` mailq |grep hostname.com -B 2 |grep ^[A-Z0-9]|awk '{print $1}'` ; do postsuper -d $f; done

Monday, August 15, 2011

mrepo

http://dag.wieers.com/home-made/mrepo/

Saturday, August 13, 2011

SMTP Codes


211 - A system status message.
214 - A help message for a human reader follows.
220 - SMTP Service ready.
221 - Service closing.
250 - Requested action taken and completed.
251 - The recipient is not local to the server, but the server will accept and forward the message.
252 - The recipient cannot be VRFYed, but the server accepts the message and attempts delivery.

354 - Start message input and end with .. This indicates that the server is ready to accept the message itself

421 - The service is not available and the connection will be closed.
450 - The requested command failed because the user’s mailbox was unavailable (such as being full). Try again later.
451 - The command has been aborted due to a server error. (on their side)
452 - The command has been aborted because the server has insufficient system storage.

500 - The server could not recognize the command due to a syntax error.
501 - A syntax error was encountered in command arguments.
502 - This command is not implemented.
503 - The server has encountered a bad sequence of commands.
504 - A command parameter is not implemented.
550 - The requested command failed because the user’s mailbox was unavailable (such as not found)
551 - The recipient is not local to the server.
552 - The action was aborted due to exceeded storage allocation.
553 - The command was aborted because the mailbox name is invalid.
554 - The transaction failed for some unstated reason

Friday, August 12, 2011

compare packages between two RHEL systems

#generate package list on hostname1
rpm -qa --qf "%{NAME}\n" > hostname1.rpm.txt
cat ./hostname1.rpm.txt | sort | uniq > ./hostname1_final.rpm.txt

#generate package list on hostname2
rpm -qa --qf "%{NAME}\n" > hostname2.rpm.txt
cat ./hostname2.rpm.txt | sort | uniq > ./hostname2_final.rpm.txt

#you want the difference between systems - show diffs on the right and trim leading whitespace
sdiff ./hostname1.rpm.txt ./hostname2.rpm.txt | grep '>' | sed -e 's/^[> \t]*//'


#you want the difference between systems - show diffs on the left and trim trailing whitespace
sdiff ./hostname1.rpm.txt ./hostname2.rpm.txt | grep '<' | sed -e 's/[ \t<]*$//'

Wednesday, August 3, 2011

clearing a mail queue

#sendmail
sendmail -qS -v subdomain.test.com

#postfix
for f in ` mailq |egrep subdomain.test.com -B 2 |grep ^[A-Z0-9]|awk '{print $1}'` ; do postsuper -d $f; done