Wednesday, December 18, 2013

OpenBSD basic Configuration SYMON

recently i have to install symon on the server so we can see the load of the system and here are the steps with a basic configuration and auth over the web server

first installed the packages
symon-2.82          active monitoring tool
syweb-0.60          web frontend to symon


then the configuration

/etc/symon.conf
monitor { cpu(0),  mem,
          if(lo0),if(bge0),if(re0),
          pf,
          mbuf,
          proc(lighttpd),

          proc(mysqld),
          proc(named),
          proc(pure-ftpd),
          io(sd0a), io(sd0j)
} stream to 127.0.0.1 2100


/etc/symux.conf

mux 127.0.0.1 2100

source 127.0.0.1 {
          accept {
                cpu(0), 
                mem,
                if(lo0),
                if(bge0),
                if(re0),
                pf,
                mbuf,
                proc(lighttpd),
                proc(mysqld),
                proc(named),
                proc(pure-ftpd),
                io(sd0a),
                io(sd0j)
        }
        datadir "/var/www/symon/rrds/localhost"
}


/etc/rc.local
...
if [ "$symon_flags" != "NO" -a -x /usr/local/libexec/symon ];then
printf ' symon -->'; /usr/local/libexec/symon && echo "\t\t [OK]" || echo "\t\t [Failed]" ;fi

if [ "$symux_flags" != "NO" -a -x /usr/local/libexec/symux ];then
printf ' symux -->'; /usr/local/libexec/symux && echo  "\t\t [OK]" || echo "\t\t [Failed]" ;fi


$ sudo mkdir -p -m 0755 /var/www/symon/rrds/localhost
$ sudo /usr/local/share/symon/c_smrrds.sh all

configuration on the lighttpd for the auth
 ...
"mod_auth", 
...
auth.backend                = "plain"
auth.backend.plain.userfile = "/etc/lighttpd/lighttpd.user"

auth.require                = ( "/syweb" =>
                               (
                                 "method"  => "digest",
                                 "realm"   => "Authorization",
                                 "require" => "user=sax|user=moxi"
                               )
                              )

...

dont forget to put the credentials for the users on lighttpd.user file!

Thursday, December 12, 2013

OpenWebmail sending slow not as i guess

Lately i have seen that openwebmail were behaving slow so i change it to speedy_cgi as openwebmail support this one and the problem goes away but at the moment for compose some times takes more than 20s to sending it and some times just take 3s around so why not seeing actually the code for the sendmail wich it is openwebmail-send.pl and ther i see that it actually use the module SMTP so BINGo why not check out postfix if it doint their job well so guess what the answer its not at all.

when i connect to localhost it takes around 20 s to answer
$ telnet localhost 25
telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
...
22 sec after
...
220 Postfix EsMtP
quit
221 2.0.0 Bye
Connection closed by foreign host.

$ ????? so i check out the maillog and just see this when the slow answer comes

...
Dec 10 12:28:21 websrv postfix/smtpd[21048]: connect from unknown[127.0.0.1]
Dec 10 12:28:50 websrv postfix/smtpd[21048]: warning: 1.0.0.127.dnsbl.njabl.org: RBL lookup error: Host or domain name not found. Name service error for name=1.0.0.127.dnsbl.njabl.org type=A: Host not found, try again

...
so the problem did not come from openwebmail or apache or lighttpd or cgi or speedy_cgi it comes from my smtp server which it is postfix so for some reason this rbl list its taking too long to answer and just change the order and add permit_mynetworks so the problem goes away after a postfix reload