How to import Nagios config to Sensu? - monitoring

I have nagios config and Sensu test environment. And I want to add all nagios check to Sensu. Should I convert nagios configs to JSON or there are any solution, probably plugin for Sensu?
Thanks.

The check format is completely different for Sensu and Nagios. The scripts are the same, but the check definitions differ completely.
If you're hand crafting JSON, it's going to be quite painful. I would highly recommend investing in a configuration management tool like Puppet, Chef or Ansible to manage the check configurations for you programmatically.

Related

Laravel5 logs analysis of dokku

I have dokku running laravel5, I am challenged to analyze the logs since I can't use the log config daily. It must be configured as syslog.
Is there a tool like papertail that works for dokku
I want to analyze issues, the way I do it now is downloading the logs and analyze them manually
Looking for a better approach
You can configure a logging driver using the docker-options plugin to ship to papertrail or similar. Some of our users have success using the dokku-logspout plugin to ship to papertrail.
Don't use laravel, it's a horrid framework, CakePHP FTW! jk

JMX Monitoring using jboss-cli

We have an application which used JBoss 4.2.3.GA and we are migrating it to WildFly 8.2. In the old implementation, the JMX monitoring was done using twiddle. Since twiddle doesn't exist in WildFly, we are using the JBoss CLI for JMX monitoring.
Is it the right approach to use the JBoss CLI for JMX monitoring? Are there any command line tools similar to twiddle which can be used for JMX monitoring in WildFly?
One option to get something similar would be to simply query the JMX MBeans programmatically yourself. The advantage here is that your solution can be reused without depending on things like Twiddle which may be discontinued and also are compatible with other app servers.
Here is an example using Groovy to query an MBean in Tomcat and here is an example using Java to query an MBean in ActiveMQ.
If you choose to go with Groovy, you should be aware that there is a way to use Groovy (or Javascript or Python) to wrap the CLI and have more of a control flow. The CLI is great for simple declarative things, but lacks the versatility of a proper scripting language.
If you want to use pure CLI, then that's fine too, but I would suggest you create files which you can then call through bash e.g.:
$JBOSS_HOME/bin/jboss-cli.sh -c --file="my-jvm-monitoring.cli"
You might find this CLI model reference useful and also this blog about monitoring WildFly with the CLI

automating firewall config deployment

I wanted to develop a script (probably using Ruby) and with leveraging vendor provided REST APIs which should configure firewalls into Edge systems.
For example, these are various values I would need to read and use for configurations.
source:
destination:
port:
There would be several number of rules which includes different sources, destinations, ports to be mentioned in the file read. What would be the best way to save all this info and read by the script?
How are such deployments handled today using scripts? Sorry, I am quite new in automated deployments and scripting, could you please help with some pointers so that start with?
Thanks!
I use Chef - http://gettingstartedwithchef.com
There are many other tools out there for automated deployments and infrastructure provisioning. Here are some more I've encounted:
Capistrano - http://capistranorb.com/
Puppet - http://puppetlabs.com/
AWS Cloud Formation or Elastic Beanstalk - http://aws.amazon.com/cloudformation
Well you might want to take a look at Capistrano which is what's generally used in the ruby world for deploying web applications:
https://github.com/capistrano/capistrano
If you want something more generic, then you might want to investigate SSHKit (which is what Capistrano is built upon). SSHKit lets you deploy and run tasks on remote machines:
https://github.com/capistrano/sshkit

Running Lua scripts using FastCGI

I am currently trying to figure out ways to run Lua scripts using FastCGI with either lighttpd or Nginx. The only thing I was able to dig up yet was WSAPI of the Kepler project. But I wonder if there are other possibilities. Important for me is:
should be as lightweight as possible
should be stable enough to use in a production environment
Many thanks in advance.
I would recommend taking a look at this project:
http://github.com/STPeters/luafcgid
There are instructions on how to use it with nginx.

Is there a simpler way to deploy to WebSphere?

I have seen this question about deploying to WebSphere using the WAS ant tasks.
Is there a simpler way to do this? In the past I have deployed to Tomcat by dropping a war file into a directory. I was hoping there would be a similar mechanism for WebSphere that doesn't involve calling the IBM libraries or rely on RAD to be installed on your workstation.
Just a hint: if you activate "Log command assistance commands" in System Administration / Console preferences, you will get a logfile in the server log directory that contains the jython scripts for all actions you did on the console. So you can just deploy your stuff per console the first time, and then grab the commands for later and feed them into wsadmin.bat -lang jython "thecommandscomehere" for the next deployment.
There is the concept of WebSphere Rapid Deployment. It's supposed to be the same experience as what you describe for Tomcat.
One way to do it could be using Jython or jacl scripts. See those samples at IBM site.
[EDIT] Especially the wsadminlib.py.zip download near the bottom of the page contains a huge set of examples and helper functions to get you started.
WAS does provide a client jar containing some custom ant tasks. However they seem to be extremely bugy and dont work with remote servers.
IBM ANT TASK Javadoc
Netbeans also has support for was 6 and 6.1 but this again is still quite buggy, however it can be useful for generating some the bindings files etc.

Resources