Cacti 0.8.7i > In State Column

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

lorenplak
Posts: 41
Joined: Wed Feb 23, 2011 11:53 am

Cacti 0.8.7i > In State Column

Post by lorenplak »

hy,

in cacti 0.8.7i, what is the "In State" column in the device list ?
which plugin modify this value ?

Laurent
Cacti 0.8.7g - Windows - poller type : spine
php 5.2.14 - MySQL 5.1.47
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Cacti 0.8.7i > In State Column

Post by noname »

It shows duration time since the device was down.

Code: Select all

feature: Replace "event count" with last changed date for host availability
See also: http://forums.cacti.net/viewtopic.php?f=21&t=44948
lorenplak
Posts: 41
Joined: Wed Feb 23, 2011 11:53 am

Re: Cacti 0.8.7i > In State Column

Post by lorenplak »

noname wrote:It shows duration time since the device was down.

Code: Select all

feature: Replace "event count" with last changed date for host availability
See also: http://forums.cacti.net/viewtopic.php?f=21&t=44948
hello,

ok but why some of my device have no value ?
Cacti 0.8.7g - Windows - poller type : spine
php 5.2.14 - MySQL 5.1.47
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Cacti 0.8.7i > In State Column

Post by noname »

>> ok but why some of my device have no value ?

I'm not sure. Is the device down?
lorenplak
Posts: 41
Joined: Wed Feb 23, 2011 11:53 am

Re: Cacti 0.8.7i > In State Column

Post by lorenplak »

noname wrote:>> ok but why some of my device have no value ?

I'm not sure. Is the device down?
no, they are UP.
manage plugin is installed and they are manage.
Cacti 0.8.7g - Windows - poller type : spine
php 5.2.14 - MySQL 5.1.47
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Cacti 0.8.7i > In State Column

Post by noname »

>> no, they are UP.

Then they won't show anything at that column. It's normal. :)
lorenplak
Posts: 41
Joined: Wed Feb 23, 2011 11:53 am

Re: Cacti 0.8.7i > In State Column

Post by lorenplak »

noname wrote:>> no, they are UP.

Then they won't show anything at that column. It's normal. :)
OK, so what is the signification of this column ?
Cacti 0.8.7g - Windows - poller type : spine
php 5.2.14 - MySQL 5.1.47
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Cacti 0.8.7i > In State Column

Post by noname »

Here is my sample (but this is on Cacti 0.8.7g + new host.php):
Image
I turned off "Downed Device Detection" for Test E.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Cacti 0.8.7i > In State Column

Post by gandalf »

In case Cacti has always seen the device as UP, there has been no "status change", hence no "up since ..." value
R.
lorenplak
Posts: 41
Joined: Wed Feb 23, 2011 11:53 am

Re: Cacti 0.8.7i > In State Column

Post by lorenplak »

gandalf wrote:In case Cacti has always seen the device as UP, there has been no "status change", hence no "up since ..." value
R.
ok thanks.
Cacti 0.8.7g - Windows - poller type : spine
php 5.2.14 - MySQL 5.1.47
grodno5
Posts: 36
Joined: Fri Feb 18, 2005 12:49 pm
Location: US/PA
Contact:

Re: Cacti 0.8.7i > In State Column

Post by grodno5 »

Even more strange, my devices up and everything is OK with graphs, but the value of "In State" is: 4460d 10h 40m for all of them.
Any idea???
Highway
Posts: 9
Joined: Thu Apr 19, 2007 2:18 pm

Re: Cacti 0.8.7i > In State Column

Post by Highway »

grodno5 wrote:Even more strange, my devices up and everything is OK with graphs, but the value of "In State" is: 4460d 10h 40m for all of them.
Any idea???
I have the same issue currently with my 'In State' counters

Image

I just added a system and it automatically added 4472d 15h 12m
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Cacti 0.8.7i > In State Column

Post by noname »

>> I just added a system and it automatically added 4472d 15h 12m

Perform this to verify:
% mysql -u YOUR_DB_USER -p -t cacti -e 'SELECT id,status_event_count,status_rec_date FROM host;'
% php --version
% php -r 'var_dump(strtotime("0000-00-00 00:00:00"));'

And try this workaround in host.php:
function get_timeinstate($host) {
...
}elseif ($host['status_rec_date'] != "0000-00-00 00:00:00" && strtotime($host['status_rec_date']) > 943916400) {
$time = time() - strtotime($host['status_rec_date']);
...
GeoffAng
Posts: 1
Joined: Fri Aug 09, 2013 11:32 am

Re: Cacti 0.8.7i > In State Column

Post by GeoffAng »

Hi, try to update your database by following the instruction below.

STEP1: Go to your /var/www/html/cacti/lib and edit the functions.php file.

change this command:
$hosts[$host_id]["status_fail_date"] = '0000-00-00 00:00:00';
$hosts[$host_id]["status_rec_date"] = '0000-00-00 00:00:00';

to this:
if ($hosts[$host_id]["status_fail_date"] == ""){
$hosts[$host_id]["status_fail_date"] = '0000-00-00 00:00:00';}

if ($hosts[$host_id]["status_rec_date"] == ""){
$hosts[$host_id]["status_rec_date"] = '0000-00-00 00:00:00';}

then save.


STEP2:
Go to your cacti database
#mysql -u [username] -p [database name]
It will prompt you to enter your password.
Then after entering your password try to execute this command to your mysql command line:

mysql>UPDATE host SET status_fail_date = '2013-08-10 00:00:00';
mysql>UPDATE host SET status_rev_date = '2013-08-10 00:00:00';
Just update the date that highlighted.

Hope it help you.
hgpit
Posts: 2
Joined: Tue Feb 18, 2014 8:06 am
Location: UK

Re: Cacti 0.8.7i > In State Column

Post by hgpit »

Hello,

Brand new user to Cacti (trying v0.8.8b), and have just come across this same issue and followed the steps in the last post. This appeared to work, but only for existing devices.

When I added a new device, the "In State" column was back to "5194d 17h 47m". What exactly is the deal here? Is it a bug? A compatibility issue between certain versions of PHP and MySQL?

I'm not a coder, so if someone could explain if there's a permanent fix, I would be very grateful. 8)

Thank you!
Cacti v0.8.8b - CentOS5 - PHP 5.1.6 - MySQL v5.0.95
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest