Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Mar 25, 2019 12:39 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: WMI polling broke on update to 1.1.37
PostPosted: Mon Feb 11, 2019 11:00 am 
Offline

Joined: Tue Mar 24, 2009 3:32 pm
Posts: 9
I am not sure what happened, I have been using WMI since 8.6 and have been updating since then. I believe I updated from 1.1.7 to 37 and thats when WMI broke. I have also tried updating to 38.

In the poller logfile I am seeing these errors
2019/02/11 07:54:02 - SPINE: Poller[1] WARNING: Invalid Response, Device[100] TH[1] DS[2096] SCRIPT: /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php '10.1.2.217' /etc/cacti/cactiwm.pw 'Win32_PerfRawData_LocalSessionManager_TerminalServices' 'ActiveSessions,InactiveSessions,TotalSessions' , output:

If I run spine manually from the command prompt to test to make sure it works properly per the INSTALL file for spine, using sudo to run as the user that runs the poller, the output is listed correctly.

sudo -u www-data spine -R -S -V 3

Device[100] TH[1] DS[2096] SCRIPT: /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php '10.1.2.217' /etc/cacti/cactiwm.pw 'Win32_PerfRawData_LocalSessionManager_TerminalServices' 'ActiveSessions,InactiveSessions,TotalSessions' , output: ActiveSessions:2 InactiveSessions:3 TotalSessions:5

Anyone have any ideas as to what might be going on on my system?


Top
 Profile  
 
 Post subject: Re: WMI polling broke on update to 1.1.37
PostPosted: Tue Feb 12, 2019 5:12 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2296
Are you sure that this isn't an intermittent connectivity issue or remote server resource issue? The fact that you are getting the values back when running via spine at the CLI manually, suggests that if everything is in working as it should, you do get the values. So the only logical explanation for it failing is either network connectivity (routing, firewall or latency) or the remote server's resources being tied up (CPU/Memory/Disk).

I would also check on the remote server's event viewer logs to see if it shows anything.

_________________
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: WMI polling broke on update to 1.1.37
PostPosted: Tue Feb 12, 2019 10:09 am 
Offline

Joined: Tue Mar 24, 2009 3:32 pm
Posts: 9
I have about 15 different servers setup with various WMI queries. All of them stopped working, however the responses always come back via a direct wmi query, or running spine manually and not through the poller.

I believe I also updated some other packages at the same time. It was running on CentOS when I updated to 1.1.37, and then I upgraded to 10.1.1.38 and migrated over to a Ubuntu system.

Searching older threads on this, I saw someone that mentioned a potential PHP bug but he was not sure what got his working again. It looks like my PHP version is 7.2.10-0ubuntu1.

The wmic version I compiled on this system is 4.0.0tp4.

Appreciate any ideas proffered.


Top
 Profile  
 
 Post subject: Re: WMI polling broke on update to 1.1.37
PostPosted: Tue Feb 12, 2019 10:12 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2296
You will find that 1.1.38 will generate warnings all over the place when it comes to PHP 7.2. Not sure whether that would have a bearing on your WMI issue or not.

_________________
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: WMI polling broke on update to 1.1.37
PostPosted: Tue Feb 12, 2019 7:01 pm 
Offline

Joined: Tue Mar 24, 2009 3:32 pm
Posts: 9
Been doing a bit more testing. It feels like I should be getting close, but I'm still not sure what is wrong.

Cron Entry:
* * * * * www-data php /usr/share/cacti/site/poller.php 2>&1 >/dev/null | if [ -f /usr/bin/ts ] ; then ts ; else tee ; fi >> /var/log/cacti/poller-error.log


Disabling the cron job and manually running the poller as root or www-data the wmi queries work properly.(eg "php /usr/share/cacti/site/poller.php" or "sudo -u www-data php /usr/share/cacti/site/poller.php")

Edited the crontab to set it to run as root as a test and the wmi queries don't work.

I am not sure why the poller running from crontab would not work hoping someone may have seen something similar before, or maybe see something wrong with the crontab command.


Top
 Profile  
 
 Post subject: Re: WMI polling broke on update to 1.1.37
PostPosted: Wed Feb 13, 2019 9:02 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2296
Are there any messages in that poller error log? Can the poller user create a log file in that location?

_________________
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: WMI polling broke on update to 1.1.37
PostPosted: Wed Feb 13, 2019 9:57 am 
Offline

Joined: Tue Mar 24, 2009 3:32 pm
Posts: 9
There are only a few thold errors in the logs, which I wasn't using thold so I disabled it. Yes the poller user can write to it.


Top
 Profile  
 
 Post subject: Re: WMI polling broke on update to 1.1.37
PostPosted: Wed Feb 13, 2019 11:02 am 
Offline

Joined: Tue Mar 24, 2009 3:32 pm
Posts: 9
So I finally got it working. Found some other people that had scripts that ran fine at cli but not through cron and they had path environment issues. I added this to the crontab file.

PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

Just for fun here is what I put in to see the path of the crontab environment.

* * * * * www-data echo $PATH > /var/log/cacti/crontab_path.txt

/usr/bin:/bin


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 9 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