Monday, 30 May 2011

ndoutils in nagios : Could not open data sink! I'll keep trying, but some output may get lost

hi.if you got problem of connecting ndoutils to nagios with that title type of error then you can do chmod to your config files.

[root@localhost etc]# chmod 666 ndo2db.cfg
[root@localhost etc]# chmod 666 ndomod.cfg

after that you can try to tail nagios log. I'm sure that it will not error again instead it will show as:

ndomod: Successfully connected to data sink

whoops..!! don't forget to give your ndouser permission in mysql
mysql> create user 'ndouser'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on nagios.* to 'ndouser'@'localhost' identified by 'ndopassword';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
goodluck :p

Thursday, 5 May 2011

How to export mysql data from remote to local server

You are only given port 3306 on the remote server. You can't do things like ssh to manage your mysql. So here is the simple receipe:

mysqldump -u user -pmypassword -h 192.168.1.111 mydatabase mytable --where='usrstatus =1;' > test.sql

i used this command on linux but in windows you may try like this instead:

mysqldump -u user -pmypassword -h 192.168.1.111 mydatabase mytable --where="usrstatus =1;" > test.sql

notice the double quote in windows & please put your password beside -p & no space & you can use --where to tell what is your condition of table you want. please try to modify it according to your need.