error libwrap missing

22 March, 2017

While compiling bareos I got this error :

checking for socket... yes
using socket from libc
checking for library containing nanosleep... no
checking for libwrap... configure: error: *** libwrap missing

The missing library on Centos is :

tcp_wrappers-devel

Fix :

yum install tcp_wrappers-devel

Since most of us work in a mixed environment (at best), we have to deal with all environments when it comes to backups. So here is how to install Bareos on Windows. There are two methods described in the manual. However I’m doing the GUI method. (It’s Windows after all) You can download the latest Windows Bareos binary package here.

Read More

The well known, good’ol LAMP stack has slowly made place for a LEMP stack in many of my configurations. Enough articles have been written on why Apache or Nginx are better in certain situations, but I like the clean way of configuration that Nginx uses. (pronounced Engine X, hence the E in LEMP). So I generally use Nginx. I however never made an article about it, so here it is, long overdue.

Read More

bareos : 2902 Bad storage

17 March, 2017

While working with bareos backups, I got this error :

Fatal error: Bad response to Storage command: wanted 2000 OK storage , got 2902 Bad storage

Read More

We recently moved over from Slack to a self-hosted communication app : Rocket.chat . One of the things I really enjoyed on slack, was the fact that there is a huge amount of integrations. Even from bash one can write to slack. This is particularly nice for reports of cron jobs, previously I relied on e-mails, but those tend to get ignored/spammed/… not read. So I let cron jobs also slack me. On Rocket.chat there are also incoming hooks, but I could not find a script that made it dummy prove to use like the one from Sul Aga so I took his code and adapted it to work with Rocket.chat. Here is how you can do the same.

Read More

After setting up my first job in bareos, I got this error :

sysadmin-fd JobId 4: Error: bsock_tcp.c:187 bnet_host2ipaddrs() for host "bareos" failed: ERR=Name or service not known
sysadmin-fd JobId 4: Fatal error: Failed to connect to Storage daemon: bareos:9103
bareos-dir JobId 4: Fatal error: Bad response to Storage command: wanted 2000 OK storage
, got 2902 Bad storage

host2ipaddr should have given it away, but it still took some fiddling for me. I found out that bareos expects to have a DNS server set up properly to connect to clients and in this case to “bareos” (itself). If you are just testing, you can add the client/server’s directly in /etc/hosts or in Windows C:\Windows\System32\drivers\etc\hosts but if you plan to go beyond the testing phase soon, it would be best to set up a FQDN that solves from both the clients and the server.

So quick and dirty :

/etc/hosts

add :

127.0.1.1 bareos

And the errors melted like snow under the sun 🙂

I’m still a fan of iptables, I know firewalld is most likely the “wrapped iptables” future, but let’s hold on to iptables for just a bit longer shall we ? This is a short how-to on cleaning up PREROUTING NAT rules. PREROUTING can’t be flushed using iptables -F so its a bit different.
Read More

I hit on this annoying little bugger while setting up snmpd :

snmpwalk -c servers compute-0-1 SNMPv2-MIB::sysDescr.0  No log handling enabled - turning on stderr logging
snmpwalk: No securityName specified

Version of snmp :

snmpd -v

NET-SNMP version:  5.5
Web:               http://www.net-snmp.org/
Email:             net-snmp-coders@lists.sourceforge.net

In this particilar case I had to specificaly add the security version (v1,v2c,v3) :

snmpwalk -v 2c -c servers compute-0-1 SNMPv2-MIB::sysDescr.0

And it works 🙂

Just playing around with bareos-webui and suddenly I’m greeted with a 500 error on the website. The director was running nicely and /var/log/messages did not show anything. Since this is a web server error, luckily there is something logged in the /var/log/httpd/error.log :

[Fri Mar 10 16:38:08.009365 2017] [:error] [pid 11266] [client hidden-ip:64292] PHP Fatal error:  Uncaught exception 'Zend\\Session\\Exception\\RuntimeException' with message 'Session validation failed' in /usr/share/bareos-webui/vendor/zendframework/zend-session/src/SessionManager.php:130\nStack trace:\n#0 /usr/share/bareos-webui/module/Application/Module.php(76): Zend\\Session\\SessionManager->start()\n#1 /usr/share/bareos-webui/module/Application/Module.php(43): Application\\Module->initSession(Object(Zend\\Mvc\\MvcEvent))\n#2 [internal function]: Application\\Module->onBootstrap(Object(Zend\\Mvc\\MvcEvent))\n#3 /usr/share/bareos-webui/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\\Mvc\\MvcEvent))\n#4 /usr/share/bareos-webui/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\\EventManager\\EventManager->triggerListeners('bootstrap', Object(Zend\\Mvc\\MvcEvent), Array)\n#5 /usr/share/bareos-webui/vendor/zendframework/zend-mvc/src/Application.php(157): Zend\\EventManager\\EventManager->trigger('bootstrap', Object(Zend\\Mvc\\MvcEvent))\n#6 /usr/share/bareos-web in /usr/share/bareos-webui/vendor/zendframework/zend-session/src/SessionManager.php on line 130

It seems its a known error for bareos-webui, the workaround is deleting the cookie related to bareos-webui. Thanks to this google post.

In the last posts, we setup bareos and connected a client to the bareos server, there are however no backup jobs auto-magically added to the bareos server so that’s our job. At first creating a job seems difficult and complex, but most of the options only become interesting in specific applications and a simple basic job can be configured pretty easy. That’s what I am going to do now, create a backup job that will incremental backup the /etc directory of my Linux client.
Read More