Notes are not saved for a few services

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Notes are not saved for a few services

Post by vmesquita »

Hello,

I realized that with some services, changing the "Notes" field under Service Status Detail doesn't work. I write a new note, click on save and the note disappears. However this works fine for other services. How can we fix this?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Notes are not saved for a few services

Post by npolovenko »

Hello, @vmesquita. Would you be able to open a 'developers console' in your web browser and look for any errors? That needs to be done immediately after you submit the note.
Also, you could run this command while submitting it:

Code: Select all

tail -f /var/log/httpd/error_log
That will show if apache gets any errors.
Please share the output with us.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Notes are not saved for a few services

Post by vmesquita »

On the developer console I got this:

Code: Select all

GET https://www.youtube.com/embed/fTYU3_yKjLc?rel=0&showinfo=0&iv_load_policy=3 403 (URLBlocked)
fTYU3_yKjLc:12 Mixed Content: The page at 'https://www.youtube.com/embed/fTYU3_yKjLc?rel=0&showinfo=0&iv_load_policy=3' was loaded over HTTPS, but requested an insecure stylesheet '<Editted, our URL>/css/Sistema.css'. This request has been blocked; the content must be served over HTTPS.
fTYU3_yKjLc:19 Mixed Content: The page at 'https://www.youtube.com/embed/fTYU3_yKjLc?rel=0&showinfo=0&iv_load_policy=3' was loaded over HTTPS, but requested an insecure image '<Editted, our URL>/img/logoSistemas.gif'. This content should also be served over HTTPS.
fTYU3_yKjLc:39 Mixed Content: The page at 'https://www.youtube.com/embed/fTYU3_yKjLc?rel=0&showinfo=0&iv_load_policy=3' was loaded over HTTPS, but requested an insecure image '<Editted, our URL>/img/erro_15x15.gif'. This content should also be served over HTTPS.
On /var/log/httpd/error_log I got:

Code: Select all

[Mon Jan 08 19:09:14 2018] [error] [client 172.27.143.22] PHP Notice:  Undefined variable: service_ids in /usr/local/nagiosxi/html/includes/components/nocscreen/nocscreenapi.php on line 327, referer: http://nagios/nagiosxi/includes/components/nocscreen/noc.php?host=&hostgroup=Producao&servicegroup=&state=&hide_soft=0&hide_not_dis=0&reporttimesubmitbutton=
[Mon Jan 08 19:09:14 2018] [error] [client 172.27.143.22] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/components/nocscreen/nocscreenapi.php on line 327, referer: http://nagios/nagiosxi/includes/components/nocscreen/noc.php?host=&hostgroup=Producao&servicegroup=&state=&hide_soft=0&hide_not_dis=0&reporttimesubmitbutton=
[Mon Jan 08 19:09:14 2018] [error] [client 172.27.143.22] PHP Notice:  Undefined variable: host_ids_str in /usr/local/nagiosxi/html/includes/components/nocscreen/nocscreenapi.php on line 338, referer: http://nagios/nagiosxi/includes/components/nocscreen/noc.php?host=&hostgroup=Producao&servicegroup=&state=&hide_soft=0&hide_not_dis=0&reporttimesubmitbutton=
[Mon Jan 08 19:09:14 2018] [error] [client 172.27.143.22] PHP Notice:  Undefined variable: service_ids_str in /usr/local/nagiosxi/html/includes/components/nocscreen/nocscreenapi.php on line 342, referer: http://nagios/nagiosxi/includes/components/nocscreen/noc.php?host=&hostgroup=Producao&servicegroup=&state=&hide_soft=0&hide_not_dis=0&reporttimesubmitbutton=
[Mon Jan 08 19:09:14 2018] [error] [client 172.27.143.22] PHP Notice:  Undefined variable: host_ids_str in /usr/local/nagiosxi/html/includes/components/nocscreen/nocscreenapi.php on line 439, referer: http://nagios/nagiosxi/includes/components/nocscreen/noc.php?host=&hostgroup=Producao&servicegroup=&state=&hide_soft=0&hide_not_dis=0&reporttimesubmitbutton=
[Mon Jan 08 19:09:14 2018] [error] [client 172.27.143.22] PHP Notice:  Undefined variable: host_ids_str in /usr/local/nagiosxi/html/includes/components/nocscreen/nocscreenapi.php on line 73, referer: http://nagios/nagiosxi/includes/components/nocscreen/noc.php?host=&hostgroup=Producao&servicegroup=&state=&hide_soft=0&hide_not_dis=0&reporttimesubmitbutton=
[Mon Jan 08 19:09:14 2018] [error] [client 172.27.143.22] PHP Notice:  Undefined variable: service_ids in /usr/local/nagiosxi/html/includes/components/nocscreen/nocscreenapi.php on line 134, referer: http://nagios/nagiosxi/includes/components/nocscreen/noc.php?host=&hostgroup=Producao&servicegroup=&state=&hide_soft=0&hide_not_dis=0&reporttimesubmitbutton=
[Mon Jan 08 19:09:14 2018] [error] [client 172.27.143.22] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/components/nocscreen/nocscreenapi.php on line 134, referer: http://nagios/nagiosxi/includes/components/nocscreen/noc.php?host=&hostgroup=Producao&servicegroup=&state=&hide_soft=0&hide_not_dis=0&reporttimesubmitbutton=
[Mon Jan 08 19:09:14 2018] [error] [client 172.27.143.22] PHP Notice:  Undefined variable: host_ids_str in /usr/local/nagiosxi/html/includes/components/nocscreen/nocscreenapi.php on line 146, referer: http://nagios/nagiosxi/includes/components/nocscreen/noc.php?host=&hostgroup=Producao&servicegroup=&state=&hide_soft=0&hide_not_dis=0&reporttimesubmitbutton=
[Mon Jan 08 19:09:14 2018] [error] [client 172.27.143.22] PHP Notice:  Undefined variable: service_ids_str in /usr/local/nagiosxi/html/includes/components/nocscreen/nocscreenapi.php on line 150, referer: http://nagios/nagiosxi/includes/components/nocscreen/noc.php?host=&hostgroup=Producao&servicegroup=&state=&hide_soft=0&hide_not_dis=0&reporttimesubmitbutton=
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Notes are not saved for a few services

Post by npolovenko »

@vmesquita, Did these services always have this kind of problem, or this just started to happen? You may have corrupt tables in your database. Please run the following command:

Code: Select all

mysqlcheck -r -f -u root -pnagiosxi --all-databases
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Notes are not saved for a few services

Post by vmesquita »

Hi npolovenko,

We don't actually know when the issue started, only recently we tried to save some notes and realized it didn't work. I tried the command to fix the tables, but the tool returned OK for all tables, indicating that none was corrupted. Any more ideas?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Notes are not saved for a few services

Post by lmiltchev »

What are the permissions of the user, who is trying to enter the note (Admin > Users > Manage Users > Edit)? Are you having the same issue when you are logged in as nagiosadmin? What is the version of Nagios XI and the "Object Notes" component that you are currently using (Admin > System Extensions > Manage Components)? Are you entering a very long note? Special characters?

Try entering a note to one of the "working", and one of the "problem" services, for example "myspecialnote", then see if it was saved in the database:

Code: Select all

echo 'select * from xi_options;' | mysql -t -uroot -pnagiosxi nagiosxi | grep myspecialnote
You can search all notes by running:

Code: Select all

echo 'select * from xi_options;' | mysql -t -uroot -pnagiosxi nagiosxi | grep objectnotes
You do see any errors/crashed tables in the mysqld.log (or mariadb.log)? Do you see any ndo2db related issues in the /var/log/messages?
Be sure to check out our Knowledgebase for helpful articles and solutions!
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Notes are not saved for a few services

Post by vmesquita »

lmiltchev wrote:What are the permissions of the user, who is trying to enter the note (Admin > Users > Manage Users > Edit)? Are you having the same issue when you are logged in as nagiosadmin?
I tried with nagiosadmin, same issue
What is the version of Nagios XI and the "Object Notes" component that you are currently using (Admin > System Extensions > Manage Components)?
Nagios XI 5.4.11, Object Notes has no version information
Are you entering a very long note? Special characters?
Not really, any note, even a word, will disappear as soon as click in "Save Changes"
Try entering a note to one of the "working", and one of the "problem" services, for example "myspecialnote", then see if it was saved in the database:

Code: Select all

echo 'select * from xi_options;' | mysql -t -uroot -pnagiosxi nagiosxi | grep myspecialnote
You can search all notes by running:

Code: Select all

echo 'select * from xi_options;' | mysql -t -uroot -pnagiosxi nagiosxi | grep objectnotes
I got this error:
[root@nagios vmesquita]# echo 'select * from xi_options;' | mysql -t -uroot -pnagiosxi nagiosxi | grep myspecialnote
ERROR 1049 (42000): Unknown database 'nagiosxi'

Maybe there's a misspell in the command?
You do see any errors/crashed tables in the mysqld.log (or mariadb.log)? Do you see any ndo2db related issues in the /var/log/messages?
I checked mysqld.log and nothing, the last entry was from 3 days ago.
I did a grep for ndo2db in /var/log/messages and only got many messages like this:

Code: Select all

Jan 23 12:53:43 nagios ndo2db: Trimming timedevents.
Jan 23 12:53:43 nagios ndo2db: Trimming systemcommands.
Jan 23 12:53:43 nagios ndo2db: Trimming servicechecks.
Jan 23 12:53:43 nagios ndo2db: Trimming hostchecks.
Jan 23 12:53:43 nagios ndo2db: Trimming eventhandlers.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Notes are not saved for a few services

Post by lmiltchev »

I got this error:
[root@nagios vmesquita]# echo 'select * from xi_options;' | mysql -t -uroot -pnagiosxi nagiosxi | grep myspecialnote
ERROR 1049 (42000): Unknown database 'nagiosxi'
Perhaps you your mysql db is offloaded to a remote server? If this is the case, try running:

Code: Select all

echo 'select * from xi_options;' | mysql -h <remote ip> -t -u<username> -p<password> nagiosxi | grep myspecialnote
where you substitute the <remote ip>, <username>, and <password> with the actual ip of the offloaded mysql server, and the actual username/password that is used.

Also, can you check the mysqld.log (or mariadb.log) on the remote server for errors/crashed tables?

One more thing - is your XI an upgrade from a much older version of XI that was using postgres? Can you find your note by running the following commands?

Code: Select all

echo 'select * from xi_options;' | psql nagiosxi nagiosxi | grep myspecialnote
echo 'select * from xi_options;' | psql nagiosxi nagiosxi | grep objectnotes
Be sure to check out our Knowledgebase for helpful articles and solutions!
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Notes are not saved for a few services

Post by vmesquita »

Hi lmiltchev,

Apparently we still have postgreeSQL, this box has been running and updated for a while.
echo 'select * from xi_options;' | psql nagiosxi nagiosxi | grep myspecialnote
This one actually returns the context I put there, but somehow it doesn't make it to the interface:

Code: Select all

      384 | objectnotes_HC-I02-HML_I-leinf-hml__datasource_LeinfDS           | MySpecialNote
I found something curious: evey time I try to add a noite to any of the services in which the note is not bring saved, the note actualy goes to this service in the database. Thats' really strange
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Notes are not saved for a few services

Post by lmiltchev »

Try reinstalling the component.

1. Download the component from the Nagios Exchange:
https://exchange.nagios.org/directory/A ... nt/details

2. Install the "Ojbect Notes" component via the web UI (Admin > Manage Components > Browse > objectnotes.zip > Upload & Install)

3. Verify the version number under the "Manage Components" page. You should see version "1.1".

Next, modify the existing note or add a new one to the service in question. See if the changes will take place in the web UI.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked