|
From: Eric R. <er...@1s...> - 2002-08-23 21:14:20
|
On Fri, 23 Aug 2002, Chris Winters wrote:
> From that it sounds like you might be doing something like:
>
> [ qw/ 1, Foo 55.0 / ],
>
> Since this is using 'qw' the first member is actually '1,' and if you
> try to treat it as a number your database might barf. It would be
> difficult to tell without looking at your data file.
>
Alright, figured it out. Apparently OI doesn't like having blank fields
in the data file, as in:
$data = [
{ spops_class => 'OpenInteract::NMS::Config::Host',
field_order => [ qw/ host_name alias address parents use name
register check_command max_check_attempts checks_enabled event_handler
event_handler_enabled low_flap_threshold high_flap_threshold
flap_detection_enabled failure_prediction_enabled process_perf_data
retain_status_information retain_nonstatus_information
notification_interval notification_period notifications_options
notifications_enabled stalking_options / ],
},
[ "", "", "", "", "", "default-host", "0", "check-host-alive",
"10", "", "", "1", "", "", "1", "", "1", "1", "1", "480",
"24x7", "", "1", "" ],
[ "wavelength", "wavelength", "66.101.60.4", "", "default-host",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "" ],
];
(Only 2 example rows included, as the rest of them mirror the format of
the 2nd row.)
This data file was generated by a script which parsed a set of config
files. Not every config entry will contain every parameter, so there
-will- be undefined field values. Is there a way to make OI accept these
undefined field values, or does every field in field_order need to be
defined?
If I can't get OI to import this data I will just modify my config parsing
script and have it dump the data directly in to the OI-generated table.
No big deal.
> Well, OI isn't 'pure' in any sense. Some of the functions are too
> complex and overdesigned and thus difficult to understand for
> newcomers. But, have faith: there is a light at the end of the tunnel!
> Once you get a handle on things you can create some very cool stuff.
>
I can see the light, and it's slowly getting larger. (=
-----
Eric Reeves - Network / Systems Administrator
1st Contact Technologies - 281.333.1444
|