[op5-users] Ninja views
Per Åsberg
perasb at op5.com
Mon Oct 26 09:25:56 CET 2009
On Fri, Oct 23, 2009 at 4:11 PM, Pier <pierg75 at yahoo.it> wrote:
>
>> if the ninja_user_authentication table is empty and you
>> would like to have admin access you need you insert in to
>> this table one record, with the user_id from your nagios
>> admin user, that should be found in the user table. If you
>> do not have your Nagiosadmin in this table as well, you need
>> to create it. All other values should be set to one in the
>> ninja_user_authentication table record, well except the id
>> field as it is auto_incrementing. You also need to look into
>> the roles table to see which id the admin role has. Remember
>> this ID and check the roles_user table. If the ID of your
>> nagiosadmin can't be found in there, create a record and
>> insert the ID of your nagiosadmin, plus the admin id for the
>> role_id, which you could look up in the roles table.
> Hi.
> Thank you for the explanation...i checked in the db and actually i have no user defined in ninja_user_authentication; so i added one manually with id 1 (that actually is nagiosadmin) with all 1's in the other fields.
> I logout from ninja, logged in and i found the table emplty again:
>
> mysql> select * from ninja_user_authorization;
> +----+---------+--------------------+---------------------------+-----------------+--------------+-----------+----------------------+-------------------+
> | id | user_id | system_information | configuration_information | system_commands | all_services | all_hosts | all_service_commands | all_host_commands |
> +----+---------+--------------------+---------------------------+-----------------+--------------+-----------+----------------------+-------------------+
> | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
> +----+---------+--------------------+---------------------------+-----------------+--------------+-----------+----------------------+-------------------+
> 1 row in set (0.00 sec)
>
>
> mysql> select * from ninja_user_authorization;
> Empty set (0.00 sec)
>
>
> Why?
> Now in ninja i can see only the localhost machine (nagios) and no others.
Each time you log in to your Ninja GUI, it attempts to synchronize the
settings in your Nagios cgi.cfg. Modifying the contents of the
ninja_user_authorization table manually won't change anything since it is
overwritten at the next successful login.
The problem that you are having here, is probably a result of the fact that
Ninja is unable to find the cgi.cfg file (or any valid data in it), hence
failing to insert anything into the ninja_user_authorization table.
And Michael - the roles table doesn't do anything for you when it comes to
your Nagios installation. I understand that this is somewhat confusing but the
reason the roles table exists is simpy to make the Kohana (the underlying PHP
framwork that Ninja is built upon) auth module to work. The roles aren't
really used in Ninja today but may possibly be in the future.
I would suggest the following:
* Check cgi.cfg and make sure that nagiosadmin is mentioned there (in the
"authorized_for_" variables). Using '*' (all) will currently not work.
* Check 'nagios_base_path' (and 'nagios_etc_path' if you don't have the Nagios
/etc dir below nagios_base_path) in config/config.php and make sure it is
properly set.
Hope this helps.
Regards,
/Per
----------------------
Per Asberg
Senior Developer
www.op5.com
More information about the op5-users
mailing list