Bulk Tool - Import hosts

93 views
Skip to first unread message

Kristian Strand

unread,
Apr 4, 2016, 8:37:26 AM4/4/16
to nagrestconf-users
Hi again :)

Quick question;
I'm getting errors when trying to import hosts from a CSV file.
The error: 
Could not find file, "".

My cvs file contains the following 1 line:
107310,10.0.0.1,hsttmpl-contacts,mgmt,local-checks

And I've imported and applied the example settings from your site, so the groups and service sets should be present in NagRestConf.

Any idea what is causing this error?

Cheers
Kristian

Mark Clarkson

unread,
Apr 4, 2016, 11:04:57 AM4/4/16
to nagrestc...@googlegroups.com
I just tried it, and it worked with the file 'bob.csv':

newhost,127.0.0.1,hsttmpl-local,ds,diskstation nagios

But that was on a synology box (debian jessie) using the synology backup
file. If I try with your line it doesn't work but it says why:

1. Adding 107310 : NAGCTL ERROR: Service Set 'local-checks' not found.
Will not add host.

I also tried on my Centos 6 server, and I only changed the
'local-checks' for a service set that exists. That worked too. Both were
running version 1.174.5.

Things to try/check:

* Use nagrestconf version 1.174.5
* File name must end in '.csv'
* File must be a plain text file, not a renamed '.xls' file
* /usr/share/nagrestconf/htdocs/nagrestconf/upload must be owned by www-data
* Try a different Web Browser.
* Disable Web Browser plugins.
* Disable selinux/apparmour

In the GUI, once you've chosen the csv file, check that the file is in
/usr/share/nagrestconf/htdocs/nagrestconf/upload.

I suspect this is a Browser problem so definitely try Firefox, disabling
plugins (esp. greasemonkey) then Chrome.


Kristian Strand

unread,
Apr 6, 2016, 8:35:23 AM4/6/16
to nagrestconf-users
 Thanks for the reply Mark.
 I've tried all your steps and I'm still getting the same error: Could not find file, "".
 I can confirm that the files are present in the Upload folder and that www-data is the owner.
Are there any settings that points the Bulk Tool to a certain folder?
Is there anything that can be edited?  

   Cheers
   Kristian

Mark Clarkson

unread,
Apr 7, 2016, 6:46:19 AM4/7/16
to nagrestconf-users
On Wednesday, 6 April 2016 13:35:23 UTC+1, Kristian Strand wrote:
 I've tried all your steps and I'm still getting the same error: Could not find file, "".
 I can confirm that the files are present in the Upload folder and that www-data is the owner.
Are there any settings that points the Bulk Tool to a certain folder?
Is there anything that can be edited? 

Start Firebug/Developer Tools.
Open the hosts tab open Bulk Tools.
Open the Add Hosts tab.
Choose your csv file.
You should see 'Uploaded yourfile.csv' with green 'Success' at the bottom. 1) Do you get that also?

Now click 'Apply Changes'
In Firebug you should see the request like:
  http://1.2.3.4/nagrestconf/index.php?tab=2&sbulkapply=1&&active_tab=2&filename=bob.csv
2) Do you see that filename parameter is set?


The error you're seeing suggests that the URL parameter, 'filename=yourfile.csv', is not being sent.
I can only replicate the error you see if I don't browse for the file first, then FIrebug shows filename is empty:
  http://10.11.12.10:8888/nagrestconf/index.php?tab=2&sbulkapply=1&&active_tab=2&filename=

What are your answers for 1) and 2) ?

Kristian Strand

unread,
Apr 8, 2016, 3:07:30 AM4/8/16
to nagrestconf-users
Thanks for all the help Mark :)
The reason for the  problems I've been dealing with, in Bulk Tool, was related to the company firewall and the function is working perfect now.

Cheers
Kristian

Mark Clarkson

unread,
Apr 8, 2016, 7:06:45 AM4/8/16
to nagrestconf-users
On Friday, 8 April 2016 08:07:30 UTC+1, Kristian Strand wrote:
Thanks for all the help Mark :)
The reason for the  problems I've been dealing with, in Bulk Tool, was related to the company firewall and the function is working perfect now.

Great! Glad you got it working. Did your IT dept say what it was doing that created such a strange problem?

Kristian Strand

unread,
Apr 8, 2016, 7:37:12 AM4/8/16
to nagrestconf-users
Does IT ever disclose information on such thing? :)

Regards 
Kristian

Mark Clarkson

unread,
Apr 8, 2016, 7:40:06 AM4/8/16
to nagrestconf-users
On Friday, 8 April 2016 12:37:12 UTC+1, Kristian Strand wrote:
Does IT ever disclose information on such thing? :)


Not usually :D
Reply all
Reply to author
Forward
0 new messages