MySQL Mapping - NDO

Alessandro Ren alessandro.ren at opservices.com.br
Tue Feb 21 22:38:11 CET 2006


    There is the field "address" on the table ndo_hosts, this is the IP 
address of the host.
    In the table ndo_hoststatus you have the field current_state, that 
ranges from 0 to 2, 0 is UP, 1 is DOWN and 2 is UNREACHABLE.
    For services, from 0 to 3, as defined int eh nagios.h

#define STATE_OK            0
#define STATE_WARNING            1
#define STATE_CRITICAL            2
#define STATE_UNKNOWN            3       /* changed from -1 on 02/24/2001 */

    []s.

Mike Koponick wrote:
>
> Alessandro,
>
>  
>
> I'm using Nagios 2.0 -- NDOMOD 1.2.
>
>  
>
> If I read this correctly, the object_id connects all the appropriate 
> tables to names, etc.
>
>  
>
> The ndo_hosts table has no IP information, nor does it have an ID for 
> the hostgroup_name. I would suspect for the hostgroup_name information 
> it should also have "hostgroup_id", but it is not there either.
>
>  
>
> At this point I wonder if it would be better to try to use the 
> "built-in" database functionality, rather than NDO until NDO is more 
> firm.
>
>  
>
> All I need is host status information, and from what I can tell that 
> information is available with the built-in functionality.
>
>  
>
> Thanks in advance,
>
>  
>
> Mike
>
>  
>
>  
>
> In the table creation script I have the following:
>
>  
>
> CREATE TABLE IF NOT EXISTS `ndo_hosts` (
>
>   `host_id` int(11) NOT NULL auto_increment,
>
>   `instance_id` smallint(6) NOT NULL default '0',
>
>   `config_type` smallint(6) NOT NULL default '0',
>
>   `host_object_id` int(11) NOT NULL default '0',
>
>   `check_command_object_id` int(11) NOT NULL default '0',
>
>   `check_command_args` varchar(255) NOT NULL default '',
>
>   `eventhandler_command_object_id` int(11) NOT NULL default '0',
>
>   `eventhandler_command_args` varchar(255) NOT NULL default '',
>
>   `notification_timeperiod_object_id` int(11) NOT NULL default '0',
>
>   `check_timeperiod_object_id` int(11) NOT NULL default '0',
>
>   `failure_prediction_options` varchar(64) NOT NULL default '',
>
>   `check_interval` smallint(6) NOT NULL default '0',
>
>   `max_check_attempts` smallint(6) NOT NULL default '0',
>
>   `notification_interval` smallint(6) NOT NULL default '0',
>
>   `notify_on_down` smallint(6) NOT NULL default '0',
>
>   `notify_on_unreachable` smallint(6) NOT NULL default '0',
>
>   `notify_on_recovery` smallint(6) NOT NULL default '0',
>
>   `notify_on_flapping` smallint(6) NOT NULL default '0',
>
>   `stalk_on_up` smallint(6) NOT NULL default '0',
>
>   `stalk_on_down` smallint(6) NOT NULL default '0',
>
>   `stalk_on_unreachable` smallint(6) NOT NULL default '0',
>
>   `flap_detection_enabled` smallint(6) NOT NULL default '0',
>
>   `low_flap_threshold` double NOT NULL default '0',
>
>   `high_flap_threshold` double NOT NULL default '0',
>
>   `process_performance_data` smallint(6) NOT NULL default '0',
>
>   `freshness_checks_enabled` smallint(6) NOT NULL default '0',
>
>   `freshness_threshold` smallint(6) NOT NULL default '0',
>
>   `passive_checks_enabled` smallint(6) NOT NULL default '0',
>
>   `event_handler_enabled` smallint(6) NOT NULL default '0',
>
>   `active_checks_enabled` smallint(6) NOT NULL default '0',
>
>   `retain_status_information` smallint(6) NOT NULL default '0',
>
>   `retain_nonstatus_information` smallint(6) NOT NULL default '0',
>
>   `notifications_enabled` smallint(6) NOT NULL default '0',
>
>   `obsess_over_host` smallint(6) NOT NULL default '0',
>
>   `failure_prediction_enabled` smallint(6) NOT NULL default '0',
>
>   PRIMARY KEY  (`host_id`),
>
>   UNIQUE KEY `instance_id` (`instance_id`,`config_type`,`host_object_id`)
>
> ) ENGINE=MyISAM DEFAULT CHARSET=ascii COMMENT='Host definitions';
>
>  
>
> -----Original Message-----
> *From:* Alessandro Ren [mailto:alessandro.ren at opservices.com.br]
> *Sent:* Tuesday, February 21, 2006 12:40 PM
> *To:* Mike Koponick
> *Cc:* nagios-devel at lists.sourceforge.net
> *Subject:* Re: [Nagios-devel] MySQL Mapping - NDO
>
>  
>
>
>     The ndo_hosts has the address as far as I know, in version 1.3, it 
> does't have the hostname. The hostname is in ndo_objects table and its 
> referenced by the field host_object_id 
> <https://192.168.10.30/phpMyAdmin/sql.php?lang=en-utf-8&server=1&collation_connection=utf8_general_ci&db=nagios&table=ndo_hosts&pos=0&session_max_rows=30&disp_direction=horizontal&repeat_cells=100&dontlimitchars=0&sql_query=SELECT+%2AFROM+%60ndo_hosts%60++ORDER+BY+%60host_object_id%60+ASC>. 
> in the field name1.
>     The field objecttype_id 
> <https://192.168.10.30/phpMyAdmin/sql.php?lang=en-utf-8&server=1&collation_connection=utf8_general_ci&db=nagios&table=ndo_objects&pos=0&session_max_rows=30&disp_direction=horizontal&repeat_cells=100&dontlimitchars=0&sql_query=SELECT+%2AFROM+%60ndo_objects%60++ORDER+BY+%60objecttype_id%60+ASC> 
> in ndo_objects sets what type of object it is according to table bellow:
>
>     I hope that I could help.
>
> NDO2DB_OBJECTTYPE_HOST=1;
> NDO2DB_OBJECTTYPE_SERVICE=2;
> NDO2DB_OBJECTTYPE_HOSTGROUP=3;
> NDO2DB_OBJECTTYPE_SERVICEGROUP=4;
> NDO2DB_OBJECTTYPE_HOSTESCALATION=5;
> NDO2DB_OBJECTTYPE_SERVICEESCALATION=6;
> NDO2DB_OBJECTTYPE_HOSTDEPENDENCY=7;
> NDO2DB_OBJECTTYPE_SERVICEDEPENDENCY=8;
> NDO2DB_OBJECTTYPE_TIMEPERIOD=9;
> NDO2DB_OBJECTTYPE_CONTACT=10;
> NDO2DB_OBJECTTYPE_CONTACTGROUP=11;
> NDO2DB_OBJECTTYPE_COMMAND=12;
> NDO2DB_OBJECTTYPE_HOSTEXTINFO=13;
> NDO2DB_OBJECTTYPE_SERVICEEXTINFO=14;
>
> Mike Koponick wrote:
>
> Hello,
>  
> I'm in the process of (trying?) to map out the NDO to MySQL data. I have
> noted that the IP address is missing from the ndo_hosts table, which was
> pointed out on the list. From what I can tell at this point in my
> research, this is one of the few columns that are missing.
>  
> What should this column be named? If added, will Nagios also add the IP
> address information directly; much like it has with all other data.
>  
> The problem I'm seeing is that if I create a separate table, very few
> data items connect because the way the object_id's are defined, etc.
> This, btw is a good thing from my perspective, but is making development
> hard for a web interface.
>  
> A mapping of the NDO/Nagios/MySQL database would be nice, even if it
> were incomplete. I would look in the code myself, but my coding skills
> are not in "C" and would confuse anyone to drink heavily.
>  
> Thoughts?
>  
> Thanks in advance,
>  
> Mike
>  
>  
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642 <http://sel.as-us.falkag.net/sel?cmd=k&kid%103432&bid#0486&dat%121642>
> _______________________________________________
> Nagios-devel mailing list
> Nagios-devel at lists.sourceforge.net <mailto:Nagios-devel at lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/nagios-devel
>   
>
>  
>
> -- 
> __________________________________________________
>
> *Alessandro Ren*
>
> 	
>
> */OpServices/*
> */Luciana de Abreu, 471 - Sala 403/*
> */Porto Alegre, RS - CEP 90570-060/*
>
>  
>
> *(*   phone 55(51)3061-3588
> *4*    fax 55(51)3061-3588
>
> 	
>
> *Q*   mobile 55(51)8151-8212
> *:*   email alessandro.ren at opservices.com.br 
> <mailto:%22alessandro.ren at opservices.com.br%22>
>
> __________________________________________________
>

-- 
__________________________________________________
*Alessandro Ren*
	/*OpServices*/
/*Luciana de Abreu, 471 - Sala 403*/
/*Porto Alegre, RS - CEP 90570-060*/

*(*   phone 55(51)3061-3588
*4*    fax 55(51)3061-3588
	*Q*   mobile 55(51)8151-8212
*:*   email alessandro.ren at opservices.com.br 
<mailto:%22alessandro.ren at opservices.com.br%22>

__________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060221/63760ac7/attachment.html>


More information about the Developers mailing list