Default user and password in uchiwa with sensu

sensu

I'm trying to deploy sensu-server in my local ubuntu with uchiwa dashboard. When I end all config and start uchiwa, I try to access from other computer in my local net, with local ip and 3000 port. Uchiwa ask me user and password combination that Im not created in my uchiwa.json file any user or password. This is it:

{
"sensu": [
    {
        "name": "Sensu",
        "host": "localhost",
        "ssl": false,
        "user": "",
        "pass": "",
        "port": 4567,
        "path": "",
        "timeout": 5000
    }
],
"uchiwa": {
    "host": "192.168.1.18",
    "port": 3000,
    "stats": 10,
    "refresh": 10000
}
}

I missed something?

Best Answer

Yes you did, I missed it too:

my /etc/sensu/conf.d/uchiwa.json file contained the following:

{
    "sensu": [
        {
            "name": "Sensu",
            "host": "localhost",
            "ssl": false,
            "port": 4567,
            "path": "",
            "timeout": 5000
        }
    ],
    "uchiwa": {
        "port": 3000,
        "stats": 10,
        "refresh": 10000
    }
}

But you might notice that there is another default uchiwa.json file located in /etc/sensu/

In this uchiwa.json file it gives the username as "admin" and the password as "secret" which you might find to work for you.

Also, please note that if you are following the directions from digitalocean They aren't 100% correct. I had to move my newly created uchiwa.json file from /etc/sensu/conf.d to /etc/sensu because that is where uchiwa is looking for the configuration file according to /var/log/uchiwa.err

If you truly want no password here is what should work:

  1. move the /etc/sensu/uchiwa.json file by renaming it to uchiwa.json.old

    mv /etc/sensu/uchiwa.json /etc/sensu/uchiwa.json.old

  2. move the /etc/sensu/conf.d/uchiwa.json file to /etc/sensu/uchiwa.json

    cd /etc/sensu/conf.d && mv uchiwa.json ../
    
  3. restart the uchiwa service

    service uchiwa restart
    

This way you can get to http://<ipaddress>:3000 and not be prompted for a password.


I think I found where uchiwa is pulling from:

in /etc/init.d/uchiwa

The following line:

args="-c /etc/sensu/uchiwa.json -p /opt/uchiwa/src/public"

Can be altered to reflect the path to your uchiwa.json file, then you can restart the uchiwa service.