Page 1 of 1
NSCAFTP...?
Posted: Tue Jul 17, 2012 6:05 am
by maymann
Hi Forum,
I would like to know if there exist a add-on/configuration method to have remote clients passively ftp their alerts (My client has a very strict general "remote_clients->specific-central_out-of-our-control_FTP_server_put_only" policy).
It should be like
http://exchange.nagios.org/directory/Ad ... eb/details just with (S)FTP instead of HTTP(S)... preferably directly from all remote-clients and to a out-of-our-control central-FTP-server. The central-nagios-server would then be able to get it "locally" (site-wise) from this server...
Remote_site clients (-> Remote Nagios Servers) -> FTP_put only -> central_out-of-our-control_FTP_server <- FTP get <- central-nagios-server
I guess it would be possible to get FTP files from central-ftp-server and put input into nagios.cmd on central-nagios-server somehow, but how about the remote clients (or remote nagios servers if needed). Anyone knows a better way, or the best way to do this ?
Any input is welcome...
Thanks in advance

!
~maymann
Re: NSCAFTP...?
Posted: Tue Jul 17, 2012 7:37 pm
by jsmurphy
I normally avoid the answer "build your own solution", but I think in this case because your only option is FTP you might have to build your own solution. It shouldn't be too difficult though honestly; ask your clients to FTP flat files with a pre-determined format. From there you have many options, probably either download the file on the nagios server, format it and inject it into the command file or use NSCA with a script to do the injection... whatever you feel comfortable with really.
Unfortunately I don't see an alternative "nice" solution to the problem if you have no other communication avenue.
I wrote an article recently on injecting service checks via email... I don't condone the practice unless you are 110% sure that you trust the email sources and have put adequate restrictions on the SMTP forwards, but you could probably re-use the majority of the script I hacked together for it to inject the FTP files into the command file, look at the mailproc section:
http://roshamboot.org/main/?p=86
Re: NSCAFTP...?
Posted: Wed Jul 18, 2012 5:39 am
by maymann
Hi jsmurphy,
thanks for your nice comments and advice

!
This would give me a good start for sure, as all notifications will then be received in our central-nagios-server, but what about:
- host/service informaion
- performance information
- NagVis information
Would it be ideal (in my situation...) if I FTP host/service/NagVis information every night and restart Nagios (that then for sure needs to be in a redundant setup...) ?
How about performance information ?
Thanks in advance

!
~maymann
Re: NSCAFTP...?
Posted: Wed Jul 18, 2012 7:47 pm
by jsmurphy
Answering your bullet points directly:
1. You've lost me a bit on host/service information... Do you mean automation of adding new hosts and services? Or are you talking about actual sending of state information?
2. You won't have to do anything... as long as your partners don't chop the performance info off the description field before they send it to you... it should be included and inserted fine (assuming they are running Nagios checks to gather the information to send to you).
3. I haven't used NagVis much so you will have to excuse my ignorance but from memory NagVis gets all it's information from the NDO database which is updated when Nagios processes new checks... so again I don't think you will need to do anything special for it to work as expected.
Re: NSCAFTP...?
Posted: Thu Jul 19, 2012 2:42 am
by maymann
Hi jsmurphy,
thanks for your input and sorry for my incomplete description...
1. The goal of this project is to enable each site to manage their own local nagios installation and have full overview of that site from their local_nagios_server and transfer needed information to Redundant central_nagios_servers to provide a central overview and send out notifications (email/sms).
Dataflow:
The individual sites will have their own local_nagios_server where clients will deliver data (via NRPE or NSCA).
The idea is to have these local_nagios_servers ftp information (new hosts/servicechecks/performance data/nagvis elements/etc) to a central_out_of_our_control_ftp_server.
Redundant central_nagios_servers will get this information from this central_out_of_our_control_ftp_server and deliver central overview and notifications (email/sms).
So, I guess - actually both if possible.
2. OK - super

!
3. I think I will prefer to keep my install as flat-files if at-all possible (well knowing this will effects performance) just to have a more simple and easily transferable installation (e.g:
http://www.pnp4nagios.org/ndo2fs/start).
Thanks in advance

!
~maymann
Re: NSCAFTP...?
Posted: Thu Jul 19, 2012 10:46 pm
by jsmurphy
oh ok I understand now... hmmm this is going to get awful messy fast and my previous statement about performance data no longer holds true. (Are you sure FTP is your only avenue? I'm not sure which I condone less... this or my dodgy email job.

)
Doing some one minute swedish chef design:
- Create two folders on your FTP, one for service/host checks and one for new hosts.
- Once a night ingest new hosts and services then do the nagios restart. (Use XML or some other kind of structured data set to make this easier)
- Use a format like this for your host/service data: State^Host^(service name if a service check)^Description|performance data
- Create files with a format that allows you to determine if its a host or service check i.e. host_filename_epoch and service_filename_epoch
- When outputting the description field your partners should use the macros: $LONGHOSTOUTPUT$ | $HOSTPERFDATA$ (or $SERVICEPERFDATA$ if a service)
- Configure passive services on your side with a freshness threshold to make sure that you don't stop receiving data for hosts/services without knowing about it.
- Have some deep meditative thought about when to send notifications from one Nagios server to the other and what impact that will have to your passive service setup and the load impact on the FTP server.
This is definitely going in the top three most... unique... Nagios configurations I've ever come across

.