Thanks for the update.
When you mentioned deleting the dashboard for the user having the problem, you gave me something to test.
Sure enough, other users dashboards were working and able to be edited without issue.
So I deleted the row from the DB for the problematic user. Unfortunately this deletes every single dashboard (awwww). But I could confirm that I could then create and edit dashboards (consolation prize).
Luckily, I had taken a copy of the data before I did any deletion. So I found the new record in the database and updated it with the old data, but removed all occurrences of the apostrophe ( ' ). Now I have the dashboards back, and I can edit them again...(Angels sing)
Can we get some validation on the NagiosXI dashboards name field to make sure this is prevented for the future? We can close this thead now, thanks for the help
So a work around may be (at your own risk)
1. Take a backup
2. Identify the user_id of the affected user
Code: Select all
echo "select user_id, username from xi_users;" | psql nagiosxi nagiosxi
3. Identify the usermeta_id of the users dashboards that are failing
Code: Select all
echo "select usermeta_id from xi_usermeta where keyname = 'dashboards' and user_id = [user_id FROM STEP 2];" | psql -U nagiosxi nagiosxi
4. Grab the bad dashboard settings into a file
Code: Select all
echo "select keyvalue from xi_usermeta where keyname = 'dashboards' and usermeta_id = [usermeta_id FROM STEP 3];" | psql -U nagiosxi nagiosxi > /tmp/info.txt
5. Edit the /tmp/info.txt file to remove any apostrophe ( ' )
6. Add the following including the ( ' ) at the start of the file /tmp/info.txt (there should be no whitespace between the ( ' ) and the existing text):
Code: Select all
UPDATE xi_usermeta SET keyvalue = '
7. Add an apostrophe at the end of the file /tmp/info.txt, with no whitespace after the existing text
8. Push the updated dashboard metadata back into the database
Code: Select all
cat /tmp/dashrestore.txt | psql nagiosxi nagiosxi