#su - zimbra
$ zmcontrol -v
System/Network Engineer, Akira Muramatsu's tech blog from Huntington Beach, CA, USA
1/30/2014
12/09/2013
Zimbra high CPU usage with java process
I've been running Zimbra 8.0.2 and got a problem with almost 100% CPU usage with java processes.
I tried many solutions by applying the fix written on the forum but didn't work.... Finally found the solution for this.
NIO imap, NIOSocketSession leaking.
IMAP NIO is enabled by default with Zimbra 8.0.2. That's why Zimbra takes high CPU usage.
To disable IMAP NIO, excute the following command.
[root]# su - zimbra
[zimbra]$ zmlocalconfig -e nio_imap_enabled=false
[zimbra]$ zmmailboxdctl restart
11/05/2013
How to send Ctrl + Alt + Del in Remote Desktop session
From remote Windows computer.
Ctrl + Alt + End
control + option + end
Ctrl + Alt + End
From remote Mac computer.
control + option + end
9/04/2013
Cacti installation by yum
Cacti installation by yum.
1. yum install httpd httpd-devel
2. yum install mysql-server mysql-devel
3. yum install php php-mysql php-pdo php-mbstring php-devel
4. /usr/bin/mysqladmin -u root password 'some_password'
5. /etc/init.d/mysqld start
6. mysql -u root -p
7. delete unnecessary users
8. mysql> create database cacti;
9. mysql> exit
10. mysql -u root -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
11. access the http://cacti_IP:/cacti with your web browser.
The following error was displayed in my web browser.
Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'
I checked the web for the solution. the httpd user can't access to the db.php
chown -R apache:root /etc/cacti/db.php
chown -R apache:root /var/lib/cacti
Then, I can display the initial setup screen for cacti.
continues with the default value. then finished setup wizard.
I saw the login screen. The username and password should be 'admin'. But I couldn't log in.
I searched the web again and got the solution.
Edit the php.ini file and changed the following settings.
mysql> update user_auth set password=md5('admin') where username='admin';
3/07/2013
How to add spam filters on zimbra server.
# su - zimbra
Check current setting.
$ zmprov gacf | grep zimbraMtaRestriction
Output:
zimbraMtaRestriction: reject_non_fqdn_sender
Currently reject_non_fqdn_sender is set.
Adding sbl.spamhaus.org
$ zmprov mcf zimbraMtaRestriction reject_non_fqdn_sender zimbraMtaRestriction "reject_rbl_client sbl.spamhaus.org"
Check the result:
$ zmprov gacf | grep zimbraMtaRestriction
zimbraMtaRestriction: reject_non_fqdn_sender
zimbraMtaRestriction: reject_rbl_client sbl.spamhaus.org
Other options
Check current setting.
$ zmprov gacf | grep zimbraMtaRestriction
Output:
zimbraMtaRestriction: reject_non_fqdn_sender
Currently reject_non_fqdn_sender is set.
Adding sbl.spamhaus.org
$ zmprov mcf zimbraMtaRestriction reject_non_fqdn_sender zimbraMtaRestriction "reject_rbl_client sbl.spamhaus.org"
Check the result:
$ zmprov gacf | grep zimbraMtaRestriction
zimbraMtaRestriction: reject_non_fqdn_sender
zimbraMtaRestriction: reject_rbl_client sbl.spamhaus.org
Other options
zmprov mcf
zimbraMtaRestriction reject_invalid_hostname
zimbraMtaRestriction reject_non_fqdn_hostname
zimbraMtaRestriction reject_non_fqdn_sender
zimbraMtaRestriction "reject_rbl_client dnsbl.njabl.org"
zimbraMtaRestriction "reject_rbl_client cbl.abuseat.org"
zimbraMtaRestriction "reject_rbl_client bl.spamcop.net"
zimbraMtaRestriction "reject_rbl_client dnsbl.sorbs.net"
zimbraMtaRestriction "reject_rbl_client sbl.spamhaus.org"
zimbraMtaRestriction "reject_rbl_client relays.mail-abuse.org"
According to zimbra wiki
Labels:
PBL,
RBL,
spam filter,
Spamhaus block list,
zimbra,
zimbraMtaRestriction
2/06/2013
Canon C2020プリンタの両面印刷OFF設定方法
Macの場合
1、Webブラウザで、以下のアドレスにアクセス
2、http://localhost:631/printers/
3、_192_168_1_181、および、C2020プリンタを選択、
4、Adfministrationドロップダウンリストから、Set Default Optionsを選択
5、Generalタブをクリック
6、Print-Styleを、1-Sided Printingに変更
7、ページ下部のSet Default Optionsボタンを押す。
8、Macの現在のログインユーザ名とパスワードを聞かれるので入力する。
9、設定完了
Windowsの場合
1、コントロールパネル -> プリンタ -> Canon iR-ADV C2020/2030 PS3をクリック
2、Printer -> Propertiesをクリック
3、Printing Preferencesをクリック
4、Finishingタブをクリック
5、Print Styleを 2-Sided Printing から1-Sided Printing に変更
6、OKを2回押して設定を保存。
Labels:
2-sided printing,
Canon C2020 printer,
mac,
Windows
1/15/2013
12/20/2012
Nagiosgraph installation
1. Download nagiosgraph.
http://nagiosgraph.sourceforge.
#tar xvfz nagiosgraph-1.4.4.tar.gz
#cd nagiosgraph-1.4.4
#./install.pl
continue with interactive setup.<br />
== configuration summary ==
ng_layout standalone
ng_prefix /usr/local/nagiosgraph
ng_etc_dir /usr/local/nagiosgraph/etc
ng_bin_dir /usr/local/nagiosgraph/bin
ng_cgi_dir /usr/local/nagiosgraph/cgi
ng_doc_dir /usr/local/nagiosgraph/doc
ng_examples_dir /usr/local/nagiosgraph/examples
ng_www_dir /usr/local/nagiosgraph/share
ng_util_dir /usr/local/nagiosgraph/util
ng_var_dir /usr/local/nagiosgraph/var
ng_rrd_dir /usr/local/nagiosgraph/var/rrd
ng_log_dir /usr/local/nagiosgraph/var
ng_log_file /usr/local/nagiosgraph/var/nagiosgraph.log
ng_cgilog_file /usr/local/nagiosgraph/var/nagiosgraph-cgi.log
ng_url /nagiosgraph
ng_cgi_url /nagiosgraph/cgi-bin
ng_css_url /nagiosgraph/nagiosgraph.css
ng_js_url /nagiosgraph/nagiosgraph.js
nagios_cgi_url /nagios/cgi-bin
nagios_perfdata_file /tmp/perfdata.log
nagios_user nagios
www_user apache
modify_nagios_config n
nagios_config_file
nagios_commands_file
modify_apache_config n
apache_config_dir
apache_config_file
=====
Post installation
2. #vi /etc/nagios/nagios.cfg
add the following lines
====
# process nagios performance data using nagiosgraph
process_performance_data=1
service_perfdata_file=/tmp/perfdata.log
service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=30
service_perfdata_file_processing_command=process-service-perfdata-for-nagiosgraph
====
3. #vi /etc/nagios/objects/commands.cfg
add the following lines.
====
# command to process nagios performance data for nagiosgraph
define command {
command_name process-service-perfdata-for-nagiosgraph
command_line /usr/local/nagiosgraph/bin/insert.pl
}
====
4. #vi /etc/httpd/conf/httpd.conf
add the following line.
====
include /usr/local/nagiosgraph/etc/nagiosgraph-apache.conf
====
5. service restart
#nagios -v /etc/nagios/nagios.cfg
#service nagios restart
#service httpd restart
6. #vi /usr/share/nagios/html/config.inc.php
====
#$cfg['cgi_base_url']='/nagios/cgi-bin/';
$cfg['cgi_base_url']='/nagios/cgi-bin';
$cfg['ng_cgi_base_url']='/nagiosgraph/cgi-bin';
====
7. #cd /usr/share/nagios/html/
#cp side.php side.php.org
edit side.php like below.
# diff side.php.org side.php
92c92,100
< <li><a href="<?php echo $cfg["cgi_base_url"];?>/trends.cgi" target="<?php echo $link_target;?>">Trends</a></li>
---
>
> <li><a href="<?php echo $cfg["cgi_base_url"];?>/trends.cgi" target="<?php echo $link_target;?>">Trends</a>
> <ul>
> <li><a href="<?php echo $cfg["ng_cgi_base_url"];?>/show.cgi" target="<?php echo $link_target;?>">Graphs</a></li>
> <li><a href="<?php echo $cfg["ng_cgi_base_url"];?>/showhost.cgi" target="<?php echo $link_target;?>">Graphs by Host</a></li>
> <li><a href="<?php echo $cfg["ng_cgi_base_url"];?>/showservice.cgi" target="<?php echo $link_target;?>">Graphs by Service</a></li>
> <li><a href="<?php echo $cfg["ng_cgi_base_url"];?>/showgroup.cgi" target="<?php echo $link_target;?>">Graphs by Group</a></li>
> </ul>
> </li>
7. Refresh your nagios web page in your web browser.
nagios graph menu will be appeared.
12/06/2012
Nagios Installation
Nagios Installation
A. Nagios Server
yum install nagios nagios-plugins nagios-nrpe
yum install nagios-plugins-dig nagios-plugins-disk nagios-plugins-disk_smb nagios-plugins-dns nagios-plugins-http nagios-plugins-icmp nagios-plugins-linux_raid nagios-plugins-load nagios-plugins-log nagios-plugins-mailq nagios-plugins-mrtg nagios-plugins-nagios nagios-plugins-nwstat nagios-plugins-perl nagios-plugins-smtp nagios-plugins-snmp nagios-plugins-ssh nagios-plugins-swap nagios-plugins-tcp nagios-plugins-time nagios-plugins-users
NRPE
Servers to be monitored
yum install nagios-nrpe nagios-plugins
To be continued...
A. Nagios Server
yum install nagios nagios-plugins nagios-nrpe
yum install nagios-plugins-dig nagios-plugins-disk nagios-plugins-disk_smb nagios-plugins-dns nagios-plugins-http nagios-plugins-icmp nagios-plugins-linux_raid nagios-plugins-load nagios-plugins-log nagios-plugins-mailq nagios-plugins-mrtg nagios-plugins-nagios nagios-plugins-nwstat nagios-plugins-perl nagios-plugins-smtp nagios-plugins-snmp nagios-plugins-ssh nagios-plugins-swap nagios-plugins-tcp nagios-plugins-time nagios-plugins-users
NRPE
Servers to be monitored
yum install nagios-nrpe nagios-plugins
To be continued...
11/16/2012
Installing mod_rpaf to Amazon EC2 behind ELB
1. download mod_rpaf-0.6.tar.gz
2. tar xvfz mod_rpaf-0.6.tar.gz
3. cd mod_rpaf-0.6
According to the following link, I created the patch file like below.
http://tech.superhappykittymeow.com/?p=281
4. vi diff.diff
5. patch < diff.diff
=======
7. make rpaf-2.0
2. tar xvfz mod_rpaf-0.6.tar.gz
3. cd mod_rpaf-0.6
According to the following link, I created the patch file like below.
http://tech.superhappykittymeow.com/?p=281
4. vi diff.diff
--- mod_rpaf-2.0.c 2008-01-01 03:05:40.000000000 +0000
+++ mod_rpaf-2.0.c~ 2011-08-25 20:04:39.000000000 +0000
@@ -136,13 +136,25 @@
}
static int is_in_array(const char *remote_ip, apr_array_header_t *proxy_ips) {
- int i;
+ /* int i;
char **list = (char**)proxy_ips->elts;
for (i = 0; i < proxy_ips->nelts; i++) {
if (strcmp(remote_ip, list[i]) == 0)
return 1;
}
return 0;
+ */
+ return 1;
+}
+
+static char* last_not_in_array(apr_array_header_t *forwarded_for,
+ apr_array_header_t *proxy_ips) {
+ int i;
+ for (i = (forwarded_for->nelts)-1; i > 0; i--) {
+ if (!is_in_array(((char **)forwarded_for->elts)[i], proxy_ips))
+ break;
+ }
+ return ((char **)forwarded_for->elts)[i];
}
static apr_status_t rpaf_cleanup(void *data) {
@@ -161,7 +173,7 @@
if (!cfg->enable)
return DECLINED;
- if (is_in_array(r->connection->remote_ip, cfg->proxy_ips) == 1) {
+ /* if (is_in_array(r->connection->remote_ip, cfg->proxy_ips) == 1) { */
/* check if cfg->headername is set and if it is use
that instead of X-Forwarded-For by default */
if (cfg->headername && (fwdvalue = apr_table_get(r->headers_in, cfg->headername))) {
@@ -183,7 +195,8 @@
rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->remote_ip);
rcr->r = r;
apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null);
- r->connection->remote_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]);
+ /* r->connection->remote_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]); */
+ r->connection->remote_ip = apr_pstrdup(r->connection->pool, last_not_in_array(arr, cfg->proxy_ips));
r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip);
if (cfg->sethostname) {
const char *hostvalue;
@@ -201,7 +214,7 @@
}
}
- }
+ /* } */
return DECLINED;
}
=======
5. patch < diff.diff
6. vi Makefile
edit the fourth line like below and save it.
=======
# Makefile for mod_rpaf.c (gmake)
# $Id: Makefile 16 2007-12-13 03:40:22Z thomas $
APXS=$(shell which apxs)
#APXS2=$(shell which apxs2)
APXS2=/usr/sbin/apxs
7. make rpaf-2.0
8. make install-2.0
9. /usr/sbin/apachectl configtest
10. service httpd restart
11. Check the apache log. :)
Subscribe to:
Posts (Atom)
