Error: Unexpected token or statement in file

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Rhobar
Posts: 41
Joined: Sat Mar 16, 2013 9:23 am
Location: Rome, Italy

Re: Error: Unexpected token or statement in file

Post by Rhobar »

Hi!

Unfortunately I'm getting the same error as you can see from these:

Code: Select all

[root@vmnagios spool]# tail -50 /var/log/mysqld.log
170526 10:24:08  InnoDB: Completed initialization of buffer pool
170526 10:24:08  InnoDB: Started; log sequence number 0 44233
170526 10:24:08 [Note] Event Scheduler: Loaded 0 events
170526 10:24:08 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170526 16:22:32 [Note] /usr/libexec/mysqld: Normal shutdown

170526 16:22:32 [Note] Event Scheduler: Purging the queue. 0 events
170526 16:22:32  InnoDB: Starting shutdown...
170526 16:22:34  InnoDB: Shutdown completed; log sequence number 0 44233
170526 16:22:34 [Note] /usr/libexec/mysqld: Shutdown complete

170526 16:22:34 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170526 16:23:07 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170526 16:23:07  InnoDB: Initializing buffer pool, size = 8.0M
170526 16:23:07  InnoDB: Completed initialization of buffer pool
170526 16:23:08  InnoDB: Started; log sequence number 0 44233
170526 16:23:08 [Note] Event Scheduler: Loaded 0 events
170526 16:23:08 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170526 16:23:58 [Note] /usr/libexec/mysqld: Normal shutdown

170526 16:23:58 [Note] Event Scheduler: Purging the queue. 0 events
170526 16:23:58  InnoDB: Starting shutdown...
170526 16:24:03  InnoDB: Shutdown completed; log sequence number 0 44233
170526 16:24:03 [Note] /usr/libexec/mysqld: Shutdown complete

170526 16:24:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170526 16:24:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170526 16:24:04  InnoDB: Initializing buffer pool, size = 8.0M
170526 16:24:04  InnoDB: Completed initialization of buffer pool
170526 16:24:04  InnoDB: Started; log sequence number 0 44233
170526 16:24:04 [Note] Event Scheduler: Loaded 0 events
170526 16:24:04 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170529 10:06:02 [Note] /usr/libexec/mysqld: Normal shutdown

170529 10:06:02 [Note] Event Scheduler: Purging the queue. 0 events
170529 10:06:02  InnoDB: Starting shutdown...
170529 10:06:03  InnoDB: Shutdown completed; log sequence number 0 44233
170529 10:06:03 [Note] /usr/libexec/mysqld: Shutdown complete

170529 10:06:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170529 10:06:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170529 10:06:03  InnoDB: Initializing buffer pool, size = 8.0M
170529 10:06:03  InnoDB: Completed initialization of buffer pool
170529 10:06:04  InnoDB: Started; log sequence number 0 44233
170529 10:06:04 [Note] Event Scheduler: Loaded 0 events
170529 10:06:04 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
[root@vmnagios spool]# tail -50 /var/log/mysqld.log
170526 10:24:08  InnoDB: Completed initialization of buffer pool
170526 10:24:08  InnoDB: Started; log sequence number 0 44233
170526 10:24:08 [Note] Event Scheduler: Loaded 0 events
170526 10:24:08 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170526 16:22:32 [Note] /usr/libexec/mysqld: Normal shutdown

170526 16:22:32 [Note] Event Scheduler: Purging the queue. 0 events
170526 16:22:32  InnoDB: Starting shutdown...
170526 16:22:34  InnoDB: Shutdown completed; log sequence number 0 44233
170526 16:22:34 [Note] /usr/libexec/mysqld: Shutdown complete

170526 16:22:34 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170526 16:23:07 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170526 16:23:07  InnoDB: Initializing buffer pool, size = 8.0M
170526 16:23:07  InnoDB: Completed initialization of buffer pool
170526 16:23:08  InnoDB: Started; log sequence number 0 44233
170526 16:23:08 [Note] Event Scheduler: Loaded 0 events
170526 16:23:08 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170526 16:23:58 [Note] /usr/libexec/mysqld: Normal shutdown

170526 16:23:58 [Note] Event Scheduler: Purging the queue. 0 events
170526 16:23:58  InnoDB: Starting shutdown...
170526 16:24:03  InnoDB: Shutdown completed; log sequence number 0 44233
170526 16:24:03 [Note] /usr/libexec/mysqld: Shutdown complete

170526 16:24:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170526 16:24:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170526 16:24:04  InnoDB: Initializing buffer pool, size = 8.0M
170526 16:24:04  InnoDB: Completed initialization of buffer pool
170526 16:24:04  InnoDB: Started; log sequence number 0 44233
170526 16:24:04 [Note] Event Scheduler: Loaded 0 events
170526 16:24:04 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170529 10:06:02 [Note] /usr/libexec/mysqld: Normal shutdown

170529 10:06:02 [Note] Event Scheduler: Purging the queue. 0 events
170529 10:06:02  InnoDB: Starting shutdown...
170529 10:06:03  InnoDB: Shutdown completed; log sequence number 0 44233
170529 10:06:03 [Note] /usr/libexec/mysqld: Shutdown complete

170529 10:06:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170529 10:06:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170529 10:06:03  InnoDB: Initializing buffer pool, size = 8.0M
170529 10:06:03  InnoDB: Completed initialization of buffer pool
170529 10:06:04  InnoDB: Started; log sequence number 0 44233
170529 10:06:04 [Note] Event Scheduler: Loaded 0 events
170529 10:06:04 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution



[root@vmnagios spool]# grep ndo /var/log/nagios/nagios.log
[1496045193] Error: Could not load module '/usr/local/nagios/bin/ndomod.o' -> /var/log/nagios/spool/checkresults/nebmod9vBoNM: undefined symbol: num_objects


[root@vmnagios spool]# grep ndo /var/log/nagios/nagios.log
[1496045193] Error: Could not load module '/usr/local/nagios/bin/ndomod.o' -> /var/log/nagios/spool/checkresults/nebmod9vBoNM: undefined symbol: num_objects
[root@vmnagios spool]# grep ndo /var/log/messages
May 29 10:06:33 vmnagios nagios: Error: Could not load module '/usr/local/nagios/bin/ndomod.o' -> /var/log/nagios/spool/checkresults/nebmod9vBoNM: undefined symbol: num_objects


User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Error: Unexpected token or statement in file

Post by tgriep »

Edit the nagios.cfg file and change the following line from

Code: Select all

broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
to

Code: Select all

broker_module=/usr/local/nagios/bin/ndomod config_file=/usr/local/nagios/etc/ndomod.cfg
Save the file and restart the nagios daemon, if the correct version of the ndomod is copied over to the /usr/local/nagios/bin/ folder, that should fix the issue for you.
If not, in the src folder where you compiled the ndoutils is a files called ndo2db-3x, copy that file to the /usr/local/nagios/bin/ folder but call it ndomod and reload nagios.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Rhobar
Posts: 41
Joined: Sat Mar 16, 2013 9:23 am
Location: Rome, Italy

Re: Error: Unexpected token or statement in file

Post by Rhobar »

Finally it works!

I was using a wrond ndomod module :)

Thanks for your precious help
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Error: Unexpected token or statement in file

Post by tgriep »

Your welcome, glad it is working now. I'll lock and mark the post as solved but if you have any new questions, please feel free to open a new post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked