help me - nagios access mysql

Javier Garcia jgarcia at suse.com.ve
Mon Apr 5 06:13:33 CEST 2004




Hi Marcelo,

You must to check this:

1) The mysql user is the correct (and the password). Can be obviously, but
is necesary. You can connetc with the data base using
  mysql -u youruser -p youpassword yourdatabase
after, chech your tables writing:
  show all tables
  Of course, check the name of your database. I read in your copy/paste
"db". Some people say that is much better put "x***_host=localhost" if
your MySQL
server is in the same machine that Nagios.

2) You have to change to permisions to the cgi.cgf file. Write:

  chown nagios cgi.cfg
  chmod 600 cgi.cfg

Only the nagios user can be the propietary of the cgi file. In my case,
the user is "nagios". In other case, can be "daemon". Check who run the
nagios process in your system.

PD: You can use a good tool for create the tables and administrate nagios.
Search the Nagmin pachage, it is a module of Webmin. Nagmin have a script
for create all the necesary tables.

Regards,

j.

----
Javier Garcia
SuSE Linux C.A.
jgarcia at suse.com.ve
0416-8678334


On Sun, 4 Apr 2004, [iso-8859-1] Marcos & Marcelo wrote:

> Hi Folks,
>
>   I finally installed Nagios with Mysql support. I
> execute the file create_mysql, which create all tables
> in mysql database. However, after configuring the
> cgi.cfg, I look at the nagios.log and I receive an
> error message like that.
>
> Does anybody know how to solve it?
> Is cgi.cfg the only file that need to be configured in
> order to make nagios connect to mysql database, or
> there are others?
> nagios.log
> [1077349565] Nagios 1.2 starting... (PID=7621)
> [1077349565] Finished daemonizing... (New PID=7622)
> [1077349566] Error: Could not read program retention
> data from table programretention
> [1077349566] Error: Could not read host retention data
> from table hostretention
> [1077349566] Error: Could not read service retention
> data from table serviceretention
> [1077349566] Error: Could not lock status data tables
> in database ''
> [1077349580] Error: Could not lock status data tables
> in database ''
> [1077349595] Error: Could not lock status data tables
> in database ''
> [1077349595] SERVICE ALERT:
> c3po;FTP;CRITICAL;SOFT;1;Connection refused by host
> [1077349610] Error: Could not lock status data tables
> in database ''
> [1077349625] Error: Could not lock status data tables
> in database ''
> [1077349629] HOST ALERT:
> mmendonc-lap;DOWN;SOFT;1;/bin/ping -n -U -c 1
> 192.168.1.5
> [1077349632] HOST ALERT:
> mmendonc-lap;DOWN;SOFT;2;/bin/ping -n -U -c 1
> 192.168.1.5
> [1077349635] HOST ALERT:
> mmendonc-lap;DOWN;SOFT;3;/bin/ping -n -U -c 1
> 192.168.1.5
> [1077349638] HOST ALERT:
> mmendonc-lap;DOWN;SOFT;4;/bin/ping -n -U -c 1
> 192.168.1.5
> [1077349641] HOST ALERT:
> mmendonc-lap;DOWN;SOFT;5;/bin/ping -n -U -c 1
> 192.168.1.5
> [1077349644] HOST ALERT:
> mmendonc-lap;DOWN;SOFT;6;/bin/ping -n -U -c 1
> 192.168.1.5
> [1077349647] HOST ALERT:
> mmendonc-lap;DOWN;SOFT;7;/bin/ping -n -U -c 1
> 192.168.1.5
> [1077349650] HOST ALERT:
> mmendonc-lap;DOWN;SOFT;8;/bin/ping -n -U -c 1
> 192.168.1.5
> [1077349653] HOST ALERT:
> mmendonc-lap;DOWN;SOFT;9;/bin/ping -n -U -c 1
> 192.168.1.5
> [1077349656] HOST ALERT:
> mmendonc-lap;DOWN;HARD;10;/bin/ping -n -U -c 1
> 192.168.1.5
>
> cgi.cfg
>
> # DG EXTENDED DATA
> xeddb_host=c3po.starwars
> xeddb_port=3306
> xeddb_database=db
> xeddb_username=root
> xeddb_password=root
>
>  DB STATUS DATA (Read-Only For CGIs)
> xsddb_host=c3po.starwars
> xsddb_port=3306
> xsddb_database=db
> xsddb_username=root
> xsddb_password=root
>
> # DB COMMENT DATA (Read-Only For CGIs)
> xcddb_host=c3po.starwars
> xcddb_port=3306
> xcddb_database=db
> xcddb_username=root
> xcddb_password=root
>
> # DB DOWNTIME DATA (Read-Only For CGIs)
> xdddb_host=c3po.starwars
> xdddb_port=3306
> xdddb_database=db
> xdddb_username=root
> xdddb_password=root
>
> Thanks,
> Marcelo
>
>
>
>
> ______________________________________________________________________
>
> Yahoo! Mail - O melhor e-mail do Brasil! Abra sua conta agora:
> http://br.yahoo.com/info/mail.html
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list