Welcome, Guest. Please login or register.

Author Topic: "selectall_hashref failed" error after defining device filter for user  (Read 4386 times)

runats

  • Newbie
  • *
  • Posts: 7
    • View Profile
Hello,

I recently install NeDiO8, and everything was working fine until I created a user account and applied a device filter to it (Group=BURBSHP).

After that, each time an "out-discards" event is detected during nedi discovery, I get the following error:

EVNT:CL=nedl EL=3 TGT=CBIOCPDA1 MSG=Gi7/39 (is  CDP:CBIOCPDA2,Gi0/47)  has 1090728952 out-discards
DBD::mysql::db selectall_hashref failed: Handle is not in asynchronous mode [err was 2000 now 2000000000]
Field 'device' does not exist (not one of device="CBIOCPDA1" AND devgroup regexp "BURBSHP") at /var/nedi/inc/libdb-msq.pm line 1208.

I'm a complete newbie, so I may be misunderstanding something, but it looks like the problem is it's applying the group filter (the one I used for the user account) when trying to locate the device in the DB (CBIOCDPA1 in this case), and of course it doesn't find it as this device is in BIOBSHP group.

Any help would be highly appreciated

Thanks in advance,

Natalia

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2496
    • View Profile
    • NeDi
All those filters are referring to devices, thus group would be the device group (e.g. vtp group). Did you mean that?

However, the error you see is not supposed to occur :)  You can click on the eyes in User-Accounts to verify that this user actually sees some devices...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

runats

  • Newbie
  • *
  • Posts: 7
    • View Profile
Hi,

Thanks for the quick reply and congratulations for this great tool!

Yes, I intended to filter devices for this user by VTP domain. I manage several sites so what I intended to do is give visibility to local users in each site only to their devices. In fact, this was my second try as with the first one (filtering by device name using a regexp) I encountered the same error.

Indeed, after applying the filter I checked the user was seeing the devices I expected, and everything looked fine... In fact the device that appears in the error message is one of those devices the user shouldn't be able to see (so it's normal that the query "CBIOCPDA1" AND devgroup regexp "BURBSHP"  returns nothing)

Regards,

Natalia

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2496
    • View Profile
    • NeDi
Thanks for the feeback! Does the discovery stop after the error? Just try to avoid viewdev if so until I can find the root cause...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

runats

  • Newbie
  • *
  • Posts: 7
    • View Profile
Yes, it does stop, but the thread remains there, so active threads keep increasing after each discovery cycle.

Thanks,

Natalia

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2496
    • View Profile
    • NeDi
Ok, found it :)

in inc/libmon.pm line 346 should read:

my $viewdev = ($main::usr{$u}{vd})?&db::Select('devices','','device',"device=\"$dev\" AND $main::usr{$u}{vd}"):$dev;
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

pc_sg

  • Full Member
  • ***
  • Posts: 245
    • View Profile
Ok, found it :)

in inc/libmon.pm line 346 should read:

my $viewdev = ($main::usr{$u}{vd})?&db::Select('devices','','device',"device=\"$dev\" AND $main::usr{$u}{vd}"):$dev;

"Copy and paste" gives this:
Code: [Select]
my $viewdev = ($main::usr{$u}{vd})?&db::Select('devices','','device',"device=\"$dev\" AND $main::usr{$u}{vd}"):$dev;
Is the originally red part a , followed by a " or a , followed by a couple of ' ?

Thanks!

Paolo
« Last Edit: June 04, 2013, 08:48:07 AM by pc_sg »

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2496
    • View Profile
    • NeDi
It's two '
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

runats

  • Newbie
  • *
  • Posts: 7
    • View Profile
Hi,

It works perfectly!

Thank you,

Natalia