Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Apr 26, 2019 11:09 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: NPC - Nagios Plugin for Cacti
PostPosted: Sun Jan 27, 2019 7:49 pm 
Offline
Cacti Pro User
User avatar

Joined: Mon Jan 05, 2015 10:10 am
Posts: 753
Are there any indications of errors in the Cacti log? How about the standard error log?

_________________
Before history, there was a paradise, now dust.


Top
 Profile  
 
 Post subject: Re: NPC - Nagios Plugin for Cacti
PostPosted: Tue Jan 29, 2019 11:53 am 
Offline

Joined: Sun Jan 13, 2019 11:46 am
Posts: 11
Hi Osiris,
There are no errors in cacti.log.
But there are many errors in cacti_stderr.log.
Almost all are:" Cannot adopt OID in..." If you need me to upload the file, ask me.
Do you want me to look somewhere else?
Thank you so much for everything. Hopefully we can put it to work :lol:


Top
 Profile  
 
 Post subject: Re: NPC - Nagios Plugin for Cacti
PostPosted: Wed Jan 30, 2019 2:27 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2419
I would compress the file and then email it to [email protected] so that it can be reviewed.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: NPC - Nagios Plugin for Cacti
PostPosted: Thu Jan 31, 2019 10:33 am 
Offline

Joined: Sun Jan 13, 2019 11:46 am
Posts: 11
Hi netniV,
As you recommend, I have sent the log to [email protected]
Yesterday I was reviewing the log in depth, and I found something:
In the cacti log, the following errors appear:
- ERROR PHP DEPRECATED in Plugin 'npc': Non-static method NpcHostgroupsController::getHostgroups() should not be called statically in file: /opt/cacti/plugins/npc/controllers/sync.php on line: 150
- CMDPHP PHP ERROR Backtrace: (/plugins/npc/npc.php[76]:NpcSyncController->listHostgroups(), /plugins/npc/controllers/sync.php[150]:CactiErrorHandler())
- ERROR PHP ERROR in Plugin 'npc': Uncaught Error: Using $this when not in object context in /opt/cacti/plugins/npc/controllers/hostgroups.php:332 Stack trace: #0 /opt/cacti/plugins/npc/controllers/sync.php(150): NpcHostgroupsController::getHostgroups() #1 /opt/cacti/plugins/npc/npc.php(76): NpcSyncController->listHostgroups(Array) #2 {main} thrown in file: /opt/cacti/plugins/npc/controllers/hostgroups.php on line: 332
- CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
- CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'npc'
** And I'm disabled the plugin, having to go back to Console -> Settings -> Plugins to re-enable it

And on the other hand, when I run the following command in the console:
sudo tail -f /var/log/syslog
I can see that the following error is repeated:
- ndo2db[13992]: mysql_error: 'Unknown column 'long_output' in 'field list''

Hope that helps. Thank you so much for everything!!

*I also attach the log that I have sent by email


Attachments:
npc plugin log.zip [33.39 KiB]
Downloaded 6 times
Top
 Profile  
 
 Post subject: Re: NPC - Nagios Plugin for Cacti
PostPosted: Sat Feb 02, 2019 9:44 pm 
Offline
Cacti Pro User
User avatar

Joined: Mon Jan 05, 2015 10:10 am
Posts: 753
Due to your version of phone and doctrine. It's on my list of things to look at, but it's way down it. Likely works better on strait centos 7.

_________________
Before history, there was a paradise, now dust.


Top
 Profile  
 
 Post subject: Re: NPC - Nagios Plugin for Cacti
PostPosted: Mon Feb 04, 2019 10:36 am 
Offline

Joined: Sun Jan 13, 2019 11:46 am
Posts: 11
Hi Osiris,
Sorry for my ignorance, but I think that seeing the log is more likely to be a php problem, rather than the version. :oops:
I am currently using Ubuntu.
Thank you very much for the help!!


Top
 Profile  
 
 Post subject: Re: NPC - Nagios Plugin for Cacti
PostPosted: Wed Feb 06, 2019 6:59 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2419
Might have been a mix up there but yea I would agree that this looks like a PHP problem. I have had it before when I switched a function from being an instance function to being a static but the code had a line that referenced $this. Not sure if that was the case with this, but I've just updated the two lines with what I believe to be the correct usage. See how you fair with the latest develop version.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: NPC - Nagios Plugin for Cacti
PostPosted: Fri Feb 08, 2019 1:58 pm 
Offline

Joined: Sun Jan 13, 2019 11:46 am
Posts: 11
Hi netniV,
I downloaded the latest version, and it's more stable.
It still does not work, but there are fewer errors.
The errors that appear to me now are:
NPC DEBUG [NpcLayoutController] (drawLayout) - Script execution time: 0.00 seconds
NPC DEBUG [NpcNagiosController] (getProgramStatus) - Script execution time: 0.07 seconds
NPC DEBUG [NpcHostsController] (summary) - Script execution time: 0.00 seconds
NPC DEBUG [NpcHostgroupsController] (getHostgroupServiceStatus) - Script execution time: 0.00 seconds
NPC DEBUG [NpcServicesController] (summary) - Script execution time: 0.00 seconds
NPC DEBUG [NpcServicesController] (getServices) - Script execution time: 0.01 seconds
NPC DEBUG [NpcServicegroupsController] (getServicegroups) - Method execution time: 0.00 seconds
NPC DEBUG [NpcServicegroupsController] (getHostStatusPortlet) - Method execution time: 0.00 seconds
NPC DEBUG [NpcServicegroupsController] (getHostStatusPortlet) - Script execution time: 0.00 seconds
NPC DEBUG [NpcLogentriesController] (getLogs) - Script execution time: 0.01 seconds
NPC DEBUG [NpcServicegroupsController] (getServicegroups) - Method execution time: 0.00 seconds
NPC DEBUG [NpcServicegroupsController] (getServicegroupServiceStatus) - Method execution time: 0.00 seconds
NPC DEBUG [NpcServicegroupsController] (getServicegroupServiceStatus) - Script execution time: 0.00 seconds
NPC DEBUG [NpcHostgroupsController] (getHostgroupHostStatus) - Script execution time: 0.00 seconds
NPC DEBUG [NpcHostsController] (getHosts) - Script execution time: 0.01 seconds
NPC DEBUG [NpcNagiosController] (checkPerf) - Script execution time: 0.01 seconds
NPC DEBUG [NpcHostsController] (getHosts) - Script execution time: 0.01 seconds
NPC DEBUG [NpcCactiController] (getHostTemplates) - Script execution time: 0.02 seconds
NPC DEBUG [NpcSyncController] (listHostgroups) - Script execution time: 0.01 seconds
NPC DEBUG [NpcSyncController] (getHosts) - Script execution time: 0.00 seconds
NPC DEBUG [NpcHostsController] (getHosts) - Script execution time: 0.01 seconds
NPC DEBUG [NpcNagiosController] (getProgramStatus) - Script execution time: 0.00 seconds
NPC DEBUG [NpcHostsController] (getHosts) - Script execution time: 0.01 seconds
NPC DEBUG [NpcHostsController] (summary) - Script execution time: 0.00 seconds
NPC DEBUG [NpcServicesController] (summary) - Script execution time: 0.00 seconds
NPC DEBUG [NpcHostgroupsController] (getHostgroupServiceStatus) - Script execution time: 0.00 seconds
NPC DEBUG [NpcServicesController] (getServices) - Script execution time: 0.01 seconds
NPC DEBUG [NpcServicegroupsController] (getServicegroups) - Method execution time: 0.00 seconds
NPC DEBUG [NpcServicegroupsController] (getServicegroupServiceStatus) - Method execution time: 0.00 seconds
NPC DEBUG [NpcServicegroupsController] (getServicegroupServiceStatus) - Script execution time: 0.00 seconds
NPC DEBUG [NpcServicegroupsController] (getServicegroups) - Method execution time: 0.00 seconds
NPC DEBUG [NpcServicegroupsController] (getHostStatusPortlet) - Method execution time: 0.00 seconds
NPC DEBUG [NpcServicegroupsController] (getHostStatusPortlet) - Script execution time: 0.00 seconds
NPC DEBUG [NpcHostgroupsController] (getHostgroupHostStatus) - Script execution time: 0.00 seconds

I have looked in the cacti database, and it does not insert any data.
Could it be for some privilege of some folder or some executable? ¿Maybe nagios.cmd?
As a tip, I think it would be nice to introduce how the privileges are to be in the manual so that there is no doubt.
It would also be interesting to modify the document "upgrade_schema" and add "IF NOT EXISTS", leaving the structure as follows:
CREATE INDEX IF NOT EXISTS idx1 ON npc_logentries(entry_time, entry_time_usec);
CREATE INDEX IF NOT EXISTS idx1 ON npc_services(config_type);
CREATE INDEX IF NOT EXISTS idx2 ON npc_services(host_object_id);
CREATE INDEX IF NOT EXISTS idx3 ON npc_services(service_object_id);
CREATE INDEX IF NOT EXISTS idx1 ON npc_hosts(host_object_id);
CREATE INDEX IF NOT EXISTS idx2 ON npc_hosts(config_type);
CREATE INDEX IF NOT EXISTS idx1 ON npc_servicestatus(current_state);
CREATE INDEX IF NOT EXISTS idx1 ON npc_hoststatus(current_state);
CREATE INDEX IF NOT EXISTS idx1 ON npc_comments(object_id);
CREATE INDEX IF NOT EXISTS idx1 ON npc_host_graphs(host_object_id);
CREATE INDEX IF NOT EXISTS idx1 ON npc_service_graphs(service_object_id);
CREATE INDEX IF NOT EXISTS idx1 ON npc_servicechecks(service_object_id, start_time);
CREATE INDEX IF NOT EXISTS idx2 ON npc_servicechecks(instance_id, start_time);

We continue making tests. Everything to improve the plugin and start it up.
Thank you very much and greetings, :D


Top
 Profile  
 
 Post subject: Re: NPC - Nagios Plugin for Cacti
PostPosted: Tue Feb 12, 2019 4:59 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2419
I would open that as an issue on the NPC plugin so it gets tracked. I only made a minor mod to the code because it's basic PHP functionality. I don't know much about how the plugin itself works as I've never worked on it (aside from the aforementioned minor tweakage).

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group