Electricmonk

Ferry Boender

Programmer, DevOpper, Open Source enthusiast.

Blog

Ansible-cmdb v1.12: Generate a host overview of Ansible facts.

Monday, February 15th, 2016

I've just released ansible-cmdb v1.12. Ansible-cmdb takes the output of Ansible's fact gathering and converts it into a static HTML overview page containing system configuration information. It supports multiple templates and extending information gathered by Ansible with custom data.

This release includes the following bugfixes and feature improvements:

  • Bugfix: Don't parse hidden files in fact output dirs.
  • Bugfix: Various fixes in html_fancy template that prevent output from being generated if certain facts are missing.
  • Bugfix: Improved error handling to prevent ansible-cmdb from stopping on a single invalid host.
  • Improved error reporting
  • Ansible local facts (from /etc/ansible/facts.d on hosts) is now shown in the Host details overview.
  • Support undocumented extended YAML vars in hosts files.
  • txt_table: Show MemFree and MemUsed columns. (by Kurt Davis)
  • txt_table: Properly align table columns if the values are less wide than the title.

As always, packages are available for Debian, Ubuntu, Redhat, Centos and other systems. Get the new release from the Github releases page.

Openvas v8 on Ubuntu 14.04: Login failed. OMP service is down

Wednesday, January 20th, 2016

Recently I suddently couldn't log into Openvas v8 running on Ubuntu 14.04 anymore. Nothing had changed about the machine (as far as I knew), but I got the following message when trying to log in with any account:

Login failed. OMP service is down

The logs (/var/log/openvas/openvasmd.log) showed the following message:

lib  serv:WARNING:2016-01-19 15h52.12 utc:21760: Failed to shake hands with peer: The signature algorithm is not supported.
lib  serv:WARNING:2016-01-19 15h52.22 utc:21775: Failed to shake hands with peer: A TLS packet with unexpected length was received.
md   main:CRITICAL:2016-01-19 15h52.22 utc:21775: serve_client: failed to attach client session to socket 12
lib  serv:WARNING:2016-01-19 15h52.22 utc:21775:    Failed to gnutls_bye: GnuTLS internal error.
lib auth:   INFO:2016-01-19 15h53.56 utc:25472: Authentication configuration not found.

Turns out the libgnutls library was updated and it turned off support for downgrading signature algorithms.

If you got your Openvas installation from the Mrazavi Launchpad source, you can fix the problem by simply updating and upgrading:

sudo apt-get update && sudo apt-get upgrade

Ansible-cmdb v1.11: Generate a host overview of Ansible facts.

Tuesday, January 12th, 2016

I've just released ansible-cmdb v1.11. Ansible-cmdb takes the output of Ansible's fact gathering and converts it into a static HTML overview page containing system configuration information. It supports multiple templates and extending information gathered by Ansible with custom data.

This release includes the following bugfixes and feature improvements:

  • Source package improvements in man page handling (Alex Barton)
  • html_fancy template now supports OpenBSD facts.
  • html_fancy template now supports Windows (2008) facts.
  • html_fancy template now shows a link icon instead of a star for the search box URL.
  • Improved error reporting and debugging mode (-d).

Get the new release from the Github releases page.

    Ansible-cmdb v1.10 released

    Monday, December 21st, 2015

    I've just released ansible-cmdb v1.10. Ansible-cmdb takes the output of Ansible's fact gathering and converts it into a static HTML overview page containing system configuration information. It supports multiple templates and extending information gathered by Ansible with custom data.

    This is a feature and bugfix release, including the following changes:

    • Fix for UTF-8 characters appearing in hosts and fact files.
    • The searchbox now shows a star next to it, which can be used to link directly to the search results.
    • The host headers are now links, so you can easily link to them

    Screenshot:

    ansible-cmdb-v1.10

    Get the new release from the Github releases page.

    Introducing ScriptForm: Stand-alone webserver that generates forms to serve as frontends to scripts

    Monday, December 7th, 2015

    I've just releases v1.0 of ScriptForm.

    ScriptForm is a stand-alone webserver that automatically generates forms from JSON to serve as frontends to scripts. It takes a JSON file which contains form definitions, constructs web forms from this JSON and serves these to users over HTTP. The user can select a form and fill it out. When the user submits the form, it is validated and the associated script is called. Data entered in the form is passed to the script through the environment. See the Example to learn more about how it works.

    I wrote ScriptForm to quickly give non-technical users the ability to perform restricted actions through a friendly web interface. Some use-cases I've used it for so far:

    • Allow users to upload CSV files that need to be processed
    • Let non-technical users create and modify Apache htpasswd files (add, delete and reset user passwords).
    • Give customers the ability to view their services' status and restart certain services which tend to hang every so often.
    • Given a certain date range, export data as CSV files.
    • Serve as a simple REST API that's incredibly easy to set up and use. 

    Some features it includes are:

    • Very rapidly construct forms with backends.
    • Completely standalone HTTP server; only requires Python.
    • Callbacks to any kind of script / program that supports environment variables.
    • User authentication support through Basic HTAuth.
    • Validates form values before calling scripts.
    • Uploaded files are automatically saved to temporary files, which are passed on to the callback.
    • Multiple forms in a single JSON definition file.
    • Scripts can produce normal output, HTML output or stream their own HTTP response to the client. The last one lets you stream images or binaries to the browser.
    • Run scripts as different users without requiring sudo.

    ScriptForm is Free Software / Open Source software released under the GNU GPL v3.

    Some links for further information:

    Github repository / sourcehttps://github.com/fboender/scriptform
    Download releaseshttps://github.com/fboender/scriptform/releases, packages are available for Debian, Redhat and other Linux-bases systems.
    Screenshotshttps://github.com/fboender/scriptform/tree/master/doc/screenshots
    Tutorialhttps://github.com/fboender/scriptform/blob/master/doc/MANUAL.md#tutorial
    Manualhttps://github.com/fboender/scriptform/blob/master/doc/MANUAL.md

    Ansible-cmdb v1.8: Bugfixes and new columns

    Saturday, December 5th, 2015

    I've just released ansible-cmdb v1.9. Ansible-cmdb takes the output of Ansible's fact gathering and converts it into a static HTML overview page containing system configuration information. It supports multiple templates and extending information gathered by Ansible with custom data.

    This is a feature and bugfix release, including the following changes:

    • Always output UTF-8.
    • Added the 'json' template, which dumps the entire inventory including variables and groups in JSON format.
    • Included a manual page in the packages.
    • The -t/–template switch can now point to an actual filename, and no longer requires the .tpl extension to be stripped.
    • html_fancy: Fixed a bug where the search field was not properly focussed.
    • html_fancy: Use vcpus for cores + hyperthreading count (Rowin Andruscavage)
    • html_fancy: New cpu, memory, swap columns and improved sorting (Rowin Andruscavage)
    • html_fancy: Show a hosts groups in the detailed view
    • html_fancy: Move and disable/enable some default columns.
    • html_fancy: Network overview table for host details.

    Here's a screenshot showing some of the new columns:

    ansible

    Get the new release from the Github releases page.

    Bexec v0.9 has been released

    Saturday, December 5th, 2015

    Bexec is a vim plugin that allows the user to execute the current buffer. Version 0.9 has just been released.

    This version changes Bexec so it's autoloaded on demand, rather than always. This reduces Vim startup times if you're not going to use Bexec. Many thanks to Lucas Hoffmann for this change.

    The new version can be found on the Vim scripts page.

    Ansible-cmdb v1.7: New columns and togglable columns

    Sunday, November 8th, 2015

    I've just released ansible-cmdb v1.7. Ansible-cmdb takes the output of Ansible's fact gathering and converts it into a static HTML overview page containing system configuration information. It supports multiple templates and extending information gathered by Ansible with custom data.

    This is a feature and bugfix release, including the following changes:

    • Support for showing only specific columns using the -c / –columns commandline argument. This must be supported by the template. Currently html_fancy and txt_table are supported.
    • The html_fancy template now properly automatically focusses the search box.
    • Two new columns were added to the html_fancy template: kernel and timestamp. (By Rowin Andruscavage)

    Get the new release from the Github releases page.

    Screenshot showing the output of ansible-cmdb -c name,fqdn,main_ipv4,os,kernel

    ansible17

    Interesting links: October 4th 2015

    Sunday, October 4th, 2015

    Here's a bunch of links I found interesting in the last few weeks:

    Batch create new users on Linux

    Sunday, October 4th, 2015

    A while ago I had to create many new users on a Linux machine. Since I'm lazy, I opted to automate this process. The newusers command combined with pwgen (to generate new passwords) was the solution.

    First I installed pwgen, a utility to automatically generate passwords:

    $ sudo apt-get install pwgen

    I created a file with the new user names to create.

    $ cat newusers.txt
    jjohnson
    ppeterson
    ccalrson

    A simple shell one-liner generates a new file from this in the right format for the newusers tool:

    $ for USER in $(cat newusers.txt); do 
      echo "$USER:$(pwgen 12 -n1)::::/home/$USER:/bin/bash" >> newusers.created.txt;
    done
    

    Finally, we create the new users:

    $ sudo newusers newusers.created.txt

    The newusers.created.txt file was handed over to the person in charge of notifying the users about their new account.

    The text of all posts on this blog, unless specificly mentioned otherwise, are licensed under this license.