Send Netdot-users mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://osl.uoregon.edu/mailman/listinfo/netdot-users
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-users digest..."


Today's Topics:

   1. Re: Problem exporting to Nagios (Cosme Corr?a)
   2. Re: Problem exporting to Nagios (Phil Regnauld)


----------------------------------------------------------------------

Message: 1
Date: Fri, 10 Oct 2014 12:20:53 -0300
From: Cosme Corr?a <[email protected]>
Subject: Re: [Netdot-users] Problem exporting to Nagios
To: Carlos Vicente <[email protected]>, Anton Berezin
        <[email protected]>
Cc: Netdot-users <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi,

thank you.

I am not a developer. I can understand this, if I get some help.

There will be an update? There is a forecast? Must I clean all and restart?

In case I have to modify the Exporter.pm, what does it mean 'second and 
third "sections"'?

I am having some problems with Nagios export. Is there a connection?

Thanks.


On 10/9/2014 12:49 PM, Carlos Vicente wrote:
> Nice. Thank you Anton.
>
> cv
>
> On Oct 7, 2014, at 2:33 PM, Anton Berezin <[email protected]> wrote:
>
>> On Tue, Oct 07, 2014 at 02:02:20PM -0400, Carlos Vicente wrote:
>>> Hi Cosme,
>>>
>>> Seems like a bug due to Pg not understanding that particular JOIN syntax. 
>>> Please open a ticket in Redmine.
>>>
>>> All Pg experts out there with a good clue how to fix, let me know.
>> Carlos, Cosme,
>>
>> This has been fixed in my tree for a while - however, the corresponding
>> commit cannot be immediately pulled in without getting DB structure changed
>> substantially.
>>
>> https://github.com/tobez/Netdot/commit/82458a84d9ea39d47fba2cc1972e1354a96b3e7d
>>
>> However, if you apply the second and third "sections" of the
>> lib/Netdot/Exporter.pm diff, all should be good.
>>
>> \Anton.
>>
>>> cv
>>>
>>> On Oct 6, 2014, at 11:37 AM, Cosme Corr?a <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am testing Export -> Configurations -> Nagios
>>>>
>>>> With this error message:
>>>>
>>>> config_tasks.html produced the following error:
>>>>
>>>>
>>>> DBD::Pg::db selectall_arrayref failed: ERROR:  syntax error at or near ","
>>>> LINE 11:           LEFT OUTER JOIN (bgppeering, entity peer) ON d.id=...
>>>>                                               ^ [for Statement "
>>>>
>>>>           SELECT    d.id, d.snmp_managed, d.community, d.snmp_target,
>>>> d.host_device,
>>>>                     d.monitoring_template, d.down_from, d.down_until,
>>>> entity.name, entity.aliases,
>>>>                     site.name, site.number, site.aliases, contactlist.id,
>>>>                     i.id, i.number, i.name, i.description,
>>>> i.admin_status, i.monitored, i.contactlist,
>>>>                     ip.id, ip.address, ip.version, ip.parent,
>>>> ip.monitored, rr.name, zone.name,
>>>>                     service.id, service.name, ipservice.monitored,
>>>> ipservice.contactlist,
>>>>                     bgppeering.bgppeeraddr, bgppeering.contactlist,
>>>> peer.asnumber, peer.asname
>>>>           FROM      rr, zone, device d
>>>>           LEFT OUTER JOIN (bgppeering, entity peer) ON
>>>> d.id=bgppeering.device
>>>>                            AND bgppeering.entity=peer.id
>>>>                            AND bgppeering.monitored=1
>>>>           LEFT OUTER JOIN devicecontacts ON d.id=devicecontacts.device
>>>>           LEFT OUTER JOIN contactlist ON
>>>> contactlist.id=devicecontacts.contactlist
>>>>           LEFT OUTER JOIN entity ON d.used_by=entity.id
>>>>           LEFT OUTER JOIN site ON d.site=site.id,
>>>>                     interface i
>>>>           LEFT OUTER JOIN ipblock ip ON ip.interface=i.id
>>>>           LEFT OUTER JOIN ipservice ON ipservice.ip=ip.id
>>>>           LEFT OUTER JOIN service ON ipservice.service=service.id
>>>>           WHERE     d.monitored='1'
>>>>                AND  i.device=d.id
>>>>                AND  d.name=rr.id
>>>>                AND  rr.zone=zone.id
>>>>          "] at /usr/local/netdot/lib/Netdot/Exporter.pm line 85.
>>>>
>>>> Stack:
>>>>   [/usr/local/netdot/lib/Netdot/Exporter.pm:85]
>>>>   [/usr/local/netdot/lib/Netdot/Exporter/Nagios.pm:167]
>>>>   [/usr/local/netdot/htdocs/export/config_tasks.html:144]
>>>>   [/usr/local/netdot/htdocs/export/autohandler:64]
>>>>   [/usr/share/perl5/HTML/Mason/Request.pm:936]
>>>> [/usr/local/netdot/htdocs/masondata/obj/991023240/export/autohandler.obj:21]
>>>>   [/usr/local/netdot/htdocs/autohandler:76]
>>>>
>>>>
>>>> Does it make any sense?
>>>>
>>>> TIA,
>>>>
>>>> -- 
>>>> Cosme Faria Corr?a
>>>>
>>>> _______________________________________________
>>>> Netdot-users mailing list
>>>> [email protected]
>>>> https://osl.uoregon.edu/mailman/listinfo/netdot-users
>>>
>>> _______________________________________________
>>> Netdot-users mailing list
>>> [email protected]
>>> https://osl.uoregon.edu/mailman/listinfo/netdot-users
>> -- 
>> Our society can survive even a large amount of irrational regulation.
>>   -- John McCarthy

-- 
Cosme Faria Corr?a



------------------------------

Message: 2
Date: Fri, 10 Oct 2014 18:51:41 +0200
From: Phil Regnauld <[email protected]>
Subject: Re: [Netdot-users] Problem exporting to Nagios
To: Cosme Corr?a <[email protected]>
Cc: Netdot-users <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

Cosme Corr?a (cosmefc) writes:
> Hi,
> 
> thank you.
> 
> I am not a developer. I can understand this, if I get some help.

        Hi Cosme,

> There will be an update? There is a forecast? Must I clean all and restart?

        I can't speak for Carlos, there might be a minor update, but in the
        meantime, you can apply the change manually:

> In case I have to modify the Exporter.pm, what does it mean 'second and 
> third "sections"'?

        If you look at the link Anton sent:

        
https://github.com/tobez/Netdot/commit/82458a84d9ea39d47fba2cc1972e1354a96b3e7d

        ... you will see highlighted sections in red/green.

        Red means: this is what is being changed/being replaed
        Green means: this is what is replacing what was in red

        At the left is the line number in the file where the changes occur.

        The second and third "section", here, are the following changes:

Lines 95-97 in file lib/Netdot/Exporter.pm (you will probably find this
file under in /usr/local/netdot)

-          LEFT OUTER JOIN (bgppeering, entity peer) ON d.id=bgppeering.device 
-                           AND bgppeering.entity=peer.id
-                           AND bgppeering.monitored=1
+          LEFT OUTER JOIN bgppeering ON d.id=bgppeering.device AND 
bgppeering.monitored
+          LEFT OUTER JOIN entity peer ON bgppeering.entity=peer.id
           LEFT OUTER JOIN devicecontacts ON d.id=devicecontacts.device
           LEFT OUTER JOIN contactlist ON 
contactlist.id=devicecontacts.contactlist
           LEFT OUTER JOIN entity ON d.used_by=entity.id

Line 106 in the same file:

-          WHERE     d.monitored='1'
+          WHERE     d.monitored


        Start by checking that you can find the file, open it with an editor,
        and move to line 95. The lines 95-97 and 106 (prefixed with '-' above)
        should be identical to those above.

> I am having some problems with Nagios export. Is there a connection?

        Very much so - if you can at least confirm that you can find the file,
        and the affected lines, then you should make a backup of the file
        (cp lib/Netdot/Exporter.pm lib/Netdot/Exporter.pm.orig), then make
        the change to the lines 95-97 and 106.

        Then you will want to restart Apache, and test that export works.

        Cheers,
        Phil


------------------------------

_______________________________________________
Netdot-users mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-users


End of Netdot-users Digest, Vol 71, Issue 4
*******************************************

Reply via email to