Is there a way to extract data from Nagios as if it was a web service? - web-services

My situation: I'm working on a web monitoring dashboard that assembles informations from different applications and sources and generate graphs, info graphics and reports.
The applications I'm trying to integrate are CACTI, Nagios, and other local private monitoring tools. I had no problem to integrate these applications, except for Nagios (I don't have much experience with it).
What I want to know is if there is a way to use Nagios as a Web Service, or something similar, so I can expose some of the informations and use it to generate my own reports on my dashboard application.
Is it possible to do that without any epic effort?
thanks for reading.

Nagios 4.x starting with version 4.4 now includes CGIs for JSON output. Installing the newest version of Nagios might be the easiest way to go.
See the announcement here.
Review the slides from Nagios World Conference 2013 here.

The Check_MK Multisite GUI (Web base GUI using MK Livestatus) offers a web service mode, where you can send queries/commands as URL parameters and get the response as JSON in the body.
The trick is: Create a view in the GUI, which fits your needs. Then extract the URL of that view and add the parameter output_format=json. Now you should have the output in a parsable format.
For example, this URL should give you a JSON list of all services:
check_mk/view.py?view_name=allservices&output_format=json

You can try:
1) MK Livestatus http://mathias-kettner.de/checkmk_livestatus.html
it's not web service but it can give current data without any complicated action. All you need redirect this data.
2)status-json plugin http://exchange.nagios.org/directory/Addons/APIs/JSON/status-2Djson/details which return data in JSON format.
3)NagiosWS plugin but I wasn't able to get to work it yet. I think it can be done for Nagios 2.x
4)GroundWork Foundation plugin. I think I will try use it now.
I was able to get to work 1 and 2 solution now.
Otherwise you can use Icinga which can give you some JSON or XML output. Icinga is fork of Nagios and can be installed with saving all your nagios data and plugins. At least it written on Icinga's site =) They have some other solution like PHP lib.
Sorry, I cannot post only 2 link while I'm newbie on this site.
Best regards.

Worked for me - MK Livestatus http://mathias-kettner.de/checkmk_livestatus.html it's not web service but it can give current data without any complicated action. All you need redirect this data.

Related

calling web services from UNIX

I have a requirement to kickoff a workflow which is in salesforce.com thorugh web service from UNIX box. Can any one suggest me options or guide lines to achive this scenario?
I don't think you can just "kick off workflows". You'll have to perform an insert or update of records in Salesforce that will satisfy the workflow's entry criteria.
There's a Java tool called Data Loader for your basic data manipulation activities (you can download it from your own production org)
and it can be scripted for scheduled runs, has config file where you can store user's password in secure way etc. Check out the pdf guide for more ("Command Line Quick Start" chapter)
So I don't think you really need a webservice call...
Unless I misunderstood and you're talking about calling an Apex class' method that has "webservice" keyword and it will somehow perform the updates?
In that case you'll need to download the WSDL file generated for this class (Setup->Develop->Classes) and well, consume it in language of your choice (Java, PHP, Python... this link will help, steps aren't too different), then do your command line magic?
http://wiki.developerforce.com/page/Integration has tons of resources for you :)
Salesforce uses SOAP for their web service. They don't have restful web services now. Just request them to give the wsdl file.
Use this wsdl file to generate the java code. After that get their webService url so that you can proceed with your data pulling
This link may help you..
http://salesforce-walker.blogspot.in/2011/12/to-access-salesforce-data-from-java-we.html
Hope this helps

Push OO or xslt doc to google drive from django

I use pod to generate reports from django. A very smart solution, I enjoy it.
But pod solution required an Open Office (or LibreOffice) installation on client desktop (or server side).
To avoid Open Office software I will hope to send report to google drive as a new (or existing) doc from a django app (or python ...).
Someone would to share expertise with this kind of issue? Else, What would be the steps to publish a google doc from django app?
If your Python app can produce a csv file, you can upload it to Google Docs using the Documents List API and convert it into a Spreadsheet:
https://developers.google.com/google-apps/documents-list/#creating_or_uploading_spreadsheets
Many other file formats can be imported, please check the docs for more details.

HTML5 Offline storage web framework

I am looking for a web app framework which can automatically generate an HTML5 offline storage based app, so while the users become disconnected they still can view the data which normally is stored on a server
Also currently I am using Django and it would be great if there was a framework which could pull data from Django and present that as an offline app.
From the related questions suggested by stackoverflow, while writing this question, I found one interesting link mentioning that GWT has such functionality, I would like to know more about that if possible and if it can generate an HTML5 offline app
Thanks in Advance
Rather than server-side frameworks, you should be taking a look at JavaScript frameworks.
Dojo Storage will transparently select between providers such as Google Gears, Adobe AIR or plain old HTML 5 local storage. Dojo 1.5 - dojox.storage: http://dojotoolkit.org/api/1.5/dojox/storage
There's also jQuery local storage: http://plugins.jquery.com/project/saveit
... or jStorage, which can act as a storage plugin for jQuery, Prototype or MooTools: http://www.jstorage.info/
With any of these, you should be able to use a quick little AJAX call to pull (JSON perhaps) data from your server and use one of these tools to help minimise your storage code.
You're talking about a standalone app, not a django app.
This can be done with javascript (jQuery, Sproutcore, JavascriptMVC, Pyjamas ...) or Adobe AIR, or...
Pulling data from Django is just a matter of setting up a syncing method, most probably using JSON, to fill up the browser local storage. So this is not django-specific at all.
If you want a standalone django app, this can be done if you bundle in a python desktop app django with a built-in server, that's another question
You could suggest the users to create web apps or use google gears instead... I don't know if this will fill the question, but, i'm in the same way. However, I'm developing an governamental solution who will run only for some kind of people, so, I can have a few control about the user's environment... All you need to do is to use jquery to detect if user has a live connection, or offer to the users a 'preferences' page where you define the behavior of the page itself...
Some info about offline cache: http://diveintohtml5.ep.io/offline.html
PS.: In another post in stackoverflow, I 've found another question: html5 offline caching with php driven sites... The last Post said:
HTML5 offline caching does not work to make your pages interact; it works only to make a
particular page available offline. Basically, it works on a URL-by-URL basis. If you
absolutely need offline functionality, you will be forced to make it work in JS.
Also, make sure your manifest includes all resources used by all pages.
Hope this helps!
Hope it helps!!

Porting a GAE Django app to Azure AppFabric

I have a GAE+Django app and wanted to port it to Microsoft Azure AppFabric. What would be the best way to do this? It's sort of like a RESTful service with custom output that is neither JSON nor XML. All of the Azure samples force you to output either XML or JSON and I can't seem to find any samples outputting the raw output.
Any help/information will be appreciated. Thanks!
I believe it is possible, I haven't tried.
Here's a Channel 9 video on running Python on Windows Azure:
http://channel9.msdn.com/Shows/Cloud+Cover/Cloud-Cover-Episode-13-Running-Python-the-censored-edition
Yes it is possible. See https://www.windowsazure.com/en-us/develop/other/
Also https://github.com/smarx/pythonrole
So you should even be able to run django.
This is a bit late to the party, but here's a nicely packaged tutorial for running Django on Azure:
https://www.windowsazure.com/en-us/develop/python/tutorials/web-app-with-django/
Note that you can also run Linux instances raw in Azure if the rest of the PaaS isn't to your liking.

Integrating smartgwt and web2py

I'd like to build an application using smartgwt and web2py.
I am new to both.
Ultimately what I would like to do is display objects obtained from a web2py backend in a smartgwt TileGrid.
Can anyone enumerate the broad strokes of what needs to be done? Or point me to any useful resources?
Any information that would apply more to django is also welcome.
download smartgwt (excellent framework by the way) and look into this example:
file://localhost/Users/massimodipierro/Desktop/smartgwt-1.0b1/samples/Showcase/www/com.smartgwt.sample.showcase.Showcase/index.html#tiling_load_on_deamnd
which displays images in a tilegrid. The images are received from Yahoo via an http request. The response is in JSON. Look into the source code. To see the json response from Yahoo try the following URL:
http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&output=json&query=snowboard
To make this work with web2py you need to replace that URL with the URL of a web2py action that returns a similar JSON response.
I do not know much about smartgwt but I am sure on the web2py google groups there are people willing to help.
Have a look at this tutorial on using web2py with Pajamas, which is another library built on GWT.