cacti DB failed, updgrade lost everything

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Moderators, Developers

Author
Message
netniV
Cacti Guru User
Posts: 2795
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti DB failed, updgrade lost everything

#61 Post by netniV » Wed Jan 10, 2018 11:50 am

If you are using the latest Cacti, make sure you have the latest plugin for monitor from the repo too. If you do, I'll take a look at the line in question but generally $config is globally defined so shouldn't be having issues.

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#62 Post by mrscary » Wed Jan 10, 2018 11:54 am

I looked at the file and couldn't figure out what was wrong. its weird.. I got one notification about a downed device.. but not the one im trying to force getting a notification on.. its NOT on.. and cacti says "UP" LOL

netniV
Cacti Guru User
Posts: 2795
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti DB failed, updgrade lost everything

#63 Post by netniV » Wed Jan 10, 2018 12:06 pm

Do you have thold installed as well? Make sure that is also up to date. If you are working with the up to date versions, I'll run through some things to check tomorrow :)

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#64 Post by mrscary » Wed Jan 10, 2018 12:09 pm

yeah I got the latest from github. I had to get a new functions.php for thold to install.

2018/01/10 11:05:32 - SYSTEM MONITOR STATS: Time:0.17 Reboots:0 DownDevices:0 Notifications:0 Purges:0
2018/01/10 11:05:32 - SYSTEM DSSTATS STATS: Type:HOURLY, Time:0.1600
2018/01/10 11:05:31 - SYSTEM THOLD DAEMON STATS: TotalTime:0.000 MaxRuntime:0.000 Processed:0 InProcess:24 TotalDevices:66 DownDevices:3 NewDownDevices:0 MaxProcesses:4 Completed:0 Running:0 Broken:0
2018/01/10 11:05:30 - SYSTEM STATS: Time:30.3067 Method:cmd.php Processes:4 Threads:N/A Hosts:66 HostsPerProcess:17 DataSources:3798 RRDsProcessed:0


there are more than 0 down.. LOL sad to say that but I know there's one downed device I downed on purpose for testing.
Monitor Device Monitoring Active The Cacti Group 2.2
Thold Thresholds Active The Cacti Group 1.0.4

netniV
Cacti Guru User
Posts: 2795
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti DB failed, updgrade lost everything

#65 Post by netniV » Wed Jan 10, 2018 12:41 pm

Well that stats line comes from this:

$total_hosts = db_fetch_cell_prepared('SELECT count(*)
FROM host
WHERE disabled=""
AND poller_id = ?',
array($config['poller_id']));

$down_hosts = db_fetch_cell_prepared('SELECT count(*)
FROM host
WHERE status=1
AND disabled=""
AND poller_id = ?',
array($config['poller_id']));

That status = 1 is what is causing it to think those devices are down. Something definitely set them as down. The full array of known values are:

Code: Select all

array(
        0 => 'deviceUnknown',
        1 => 'deviceDown',
        2 => 'deviceRecovering',
        3 => 'deviceUp',
        4 => 'deviceThreshold',
        5 => 'deviceDownMuted',
        6 => 'deviceUnmonitored',
        7 => 'deviceWarning',
        8 => 'deviceAlert',
)
However, other plugins can set a device status too

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#66 Post by mrscary » Wed Jan 10, 2018 1:14 pm

the only plug ins on the plug page I have enabled are thold and monitor

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#67 Post by mrscary » Thu Jan 11, 2018 8:16 am

looks like monitor is now working! awesome

netniV
Cacti Guru User
Posts: 2795
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti DB failed, updgrade lost everything

#68 Post by netniV » Thu Jan 11, 2018 9:21 am

So, do we have a fully working system now? You may also want to download the version of monitor I have here:
https://github.com/netniV/plugin_monito ... /tag/28-45

It fixes a problem with displaying things when they have an invalid status (also adds the ability to auto-monitor devices added via cli)

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#69 Post by mrscary » Thu Jan 11, 2018 9:52 am

it appears all is working.. thank you so much for your efforts!
I have hp printer that is being a PITA and not giving me toner status.. that's new.. LOL same model printers work for other devices, so its probably that printer's internal issue.. dang printers.


mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#71 Post by mrscary » Thu Jan 11, 2018 2:44 pm

I wasn't gonna give in.. I was determined to keep my data! LOL

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#72 Post by mrscary » Fri Jan 12, 2018 7:41 am

mrscary wrote:this is a plug in I found particularly useful
https://docs.cacti.net/userplugin:intropage
question about this plug in.. by default puts all the boxes in one row.. but the screen shot shown is much nicer.. how does one change this layout?


mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#74 Post by mrscary » Fri Jan 12, 2018 8:11 am

yeah. it renders find in firefox. but not in IE.. (I know.. don't flame the IE user LOL)

netniV
Cacti Guru User
Posts: 2795
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti DB failed, updgrade lost everything

#75 Post by netniV » Fri Jan 12, 2018 5:47 pm

I'd have to defer to the author on that one.

If you can let me know what you think to this release of QuickTree:
https://github.com/netniV/cacti-quicktr ... 1.0-beta.2

It's had quite a bit of a rework but it's still the same underlying functionality :)

Post Reply