Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Uptime plugin (reboot monitor)
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General
Author Message
mcutting
Cacti Pro User


Joined: 16 Oct 2006
Posts: 906

PostPosted: Thu Jan 10, 2008 10:07 am    Post subject: Reply with quote

ariesow wrote:
My environment her a lot devices and most probably that 10 records is no sufficient for the records. is that possible to me to make it display more than 10 records in the "UPTIME" tab ?


A bit late, but I made some modifications to the uptime.php (better sorting, layout, and more hosts listed). You can get the updated version here.



uptime.zip
 Description:

Download
 Filename:  uptime.zip
 Filesize:  1.89 KB
 Downloaded:  184 Time(s)

Back to top
timi
Cacti User


Joined: 09 Nov 2005
Posts: 124
Location: Timisoara, Romania

PostPosted: Thu Jan 10, 2008 3:39 pm    Post subject: Reply with quote

I can't get thist pluging to work
do I need to make any changes ?

I have:
Cacti Version - 0.8.7a
Plugin Architecture - 1.4

LE: I mean it detecs the reboot of a device, but in Device section it does not show the uptime ...
Back to top
timi
Cacti User


Joined: 09 Nov 2005
Posts: 124
Location: Timisoara, Romania

PostPosted: Thu Jan 10, 2008 4:50 pm    Post subject: Reply with quote

looks like host.php need some hacks, anybody ?
Back to top
apperrault
Cacti User


Joined: 16 Feb 2007
Posts: 299
Location: Emeryville, CA

PostPosted: Tue Jan 15, 2008 12:17 pm    Post subject: Reply with quote

mcutting,
I like the look of the changes, but i had to roll back. The one thing i like about the current layout is it shows me the reboots in reverse order (most recent one at the top). I like the ability to see more than the last 10 reboots, but with the number of servers i have, it is easier for me to see what booted last, than have to choose a host and see when it booted last. Do you know of any way to extend just the number of reboots? Maybe make it configurable?

thanks

app
Back to top
myfreeke
Cacti User


Joined: 04 Dec 2007
Posts: 78

PostPosted: Tue Jan 15, 2008 11:49 pm    Post subject: Reply with quote

I runing uptime plugin on cacti 0.8.7a .but don't working !

All Devices view N/A

mysql> desc host;
+----------------------+-----------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+-----------------------+------+-----+---------------------+----------------+
| id | mediumint( unsigned | NO | PRI | NULL | auto_increment |
| host_template_id | mediumint( unsigned | NO | | 0 | |
| description | varchar(150) | NO | | | |
| hostname | varchar(250) | YES | | NULL | |
| notes | text | YES | | NULL | |
| snmp_community | varchar(100) | YES | | NULL | |
| snmp_version | tinyint(1) unsigned | NO | | 1 | |
| snmp_username | varchar(50) | YES | | NULL | |
| snmp_password | varchar(50) | YES | | NULL | |
| snmp_auth_protocol | varchar(5) | YES | | | |
| snmp_priv_passphrase | varchar(200) | YES | | | |
| snmp_priv_protocol | varchar(6) | YES | | | |
| snmp_context | varchar(64) | YES | | | |
| snmp_port | mediumint(5) unsigned | NO | | 161 | |
| snmp_timeout | mediumint( unsigned | NO | | 500 | |
| availability_method | smallint(5) unsigned | NO | | 1 | |
| ping_method | smallint(5) unsigned | YES | | 0 | |
| ping_port | int(12) unsigned | YES | | 0 | |
| ping_timeout | int(12) unsigned | YES | | 500 | |
| ping_retries | int(12) unsigned | YES | | 2 | |
| max_oids | int(12) unsigned | YES | | 10 | |
| disabled | varchar(2) | YES | MUL | NULL | |
| uptime | char(3) | NO | | on | |
| monitor | char(3) | NO | | on | |
| monitor_text | text | NO | | | |
| status | tinyint(2) | NO | | 0 | |
| status_event_count | mediumint( unsigned | NO | | 0 | |
| status_fail_date | datetime | NO | | 0000-00-00 00:00:00 | |
| status_rec_date | datetime | NO | | 0000-00-00 00:00:00 | |
| status_last_error | varchar(255) | YES | | | |
| min_time | decimal(10,5) | YES | | 9.99999 | |
| max_time | decimal(10,5) | YES | | 0.00000 | |
| cur_time | decimal(10,5) | YES | | 0.00000 | |
| avg_time | decimal(10,5) | YES | | 0.00000 | |
| total_polls | int(12) unsigned | YES | | 0 | |
| failed_polls | int(12) unsigned | YES | | 0 | |
| availability | decimal(8,5) | NO | | 100.00000 | |
| npc_host_id | int(11) | YES | | NULL | |
| reboot | varchar(3) | YES | | 0 | |
+----------------------+-----------------------+------+-----+---------------------+----------------+
39 rows in set (0.00 sec)

mysql> desc uptime;
+--------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-----------------------+------+-----+---------+-------+
| id | mediumint( unsigned | NO | | 0 | |
| uptime | bigint(20) | YES | | NULL | |
+--------+-----------------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> desc uptime_data;
+----------+-----------------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-----------------------+------+-----+---------------------+-------+
| id | mediumint( unsigned | NO | | 0 | |
| datetime | datetime | NO | | 0000-00-00 00:00:00 | |
| extra | text | YES | | NULL | |
+----------+-----------------------+------+-----+---------------------+-------+
3 rows in set (0.00 sec)



Anybody can help me!
Back to top
myfreeke
Cacti User


Joined: 04 Dec 2007
Posts: 78

PostPosted: Wed Jan 16, 2008 3:50 am    Post subject: Reply with quote

uptime view Inaccurate

[root@TS263 ~]# uptime
16:50:03 up 8 days, 22:07, 2 users, load average: 0.01, 0.14, 0.17

I use modifi Devices a host view error:
Warning: Missing argument 10 for cacti_snmp_get(), called in /var/monitor/cacti/host.php on line 574 and defined in /var/monitor/cacti/lib/snmp.php on line 39

Warning: Missing argument 10 for cacti_snmp_get(), called in /var/monitor/cacti/host.php on line 579 and defined in /var/monitor/cacti/lib/snmp.php on line 39

Warning: Missing argument 10 for cacti_snmp_get(), called in /var/monitor/cacti/host.php on line 580 and defined in /var/monitor/cacti/lib/snmp.php on line 39

Warning: Missing argument 10 for cacti_snmp_get(), called in /var/monitor/cacti/host.php on line 581 and defined in /var/monitor/cacti/lib/snmp.php on line 39

Warning: Missing argument 10 for cacti_snmp_get(), called in /var/monitor/cacti/host.php on line 582 and defined in /var/monitor/cacti/lib/snmp.php on line 39



uptime--error.JPG
 Description:
 Filesize:  4.1 KB
 Viewed:  2584 Time(s)

uptime--error.JPG


Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1989
Location: United Kingdom

PostPosted: Wed Feb 27, 2008 6:37 am    Post subject: Reply with quote

Could someone who has this working in a modern Cacti (0.8.7, PA 1.4 or 2.0) zip up their uptime folder at post it?

I *think* I've followed all the way through this thread, applying the various 'fixes', but I seem to have a half-working plugin - no new options in the Devices page, and no device list in the Uptime tab.
Back to top
mcutting
Cacti Pro User


Joined: 16 Oct 2006
Posts: 906

PostPosted: Wed Feb 27, 2008 6:42 am    Post subject: Reply with quote

Howie - try this one - I have this working under 0.8.7b PIA 2.0

Regds



uptime.zip
 Description:

Download
 Filename:  uptime.zip
 Filesize:  20.48 KB
 Downloaded:  145 Time(s)

Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1989
Location: United Kingdom

PostPosted: Wed Feb 27, 2008 7:04 am    Post subject: Reply with quote

mcutting wrote:
Howie - try this one - I have this working under 0.8.7b PIA 2.0

Regds


Ah, thanks. Still isn't working for me though... looking at the code, I don't see a hook for device_action_array, so I'm not really sure how it ever would add new actions to the hosts.php dropdown.
Back to top
mcutting
Cacti Pro User


Joined: 16 Oct 2006
Posts: 906

PostPosted: Wed Feb 27, 2008 7:06 am    Post subject: Reply with quote

Yes, this part does not work. It will only work if you open the device, and place a tick in the UPTIME field. This unfortunately means that you have to do it for every host.
Back to top
chrisgapske
Cacti User


Joined: 22 May 2007
Posts: 263
Location: Padacuh, Ky-Alpena, MI-Gulf Shores,AL

PostPosted: Wed Feb 27, 2008 8:20 am    Post subject: Reply with quote

Howie wrote:
Could someone who has this working in a modern Cacti (0.8.7, PA 1.4 or 2.0) zip up their uptime folder at post it?

I *think* I've followed all the way through this thread, applying the various 'fixes', but I seem to have a half-working plugin - no new options in the Devices page, and no device list in the Uptime tab.


you will only have devices in the uptime tab when a reboot is detcted.
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1989
Location: United Kingdom

PostPosted: Wed Feb 27, 2008 9:11 am    Post subject: Reply with quote

Thanks for your help guys, I have this working now. Now we'll see what's going on down there.

Attached is my own tweaks to mcutting's zip. I've added a little note to show that no reboots have been detected yet, and I also added the 'enable uptime' and 'disable uptime' options to the Devices list.

It'd be nice if there was a column in the Device list to show it, but I guess that would need a new hook or two (one for adding headers, and another to fill in the data, I think).



uptime-hj.zip
 Description:
my modified uptime

Download
 Filename:  uptime-hj.zip
 Filesize:  23.9 KB
 Downloaded:  187 Time(s)

Back to top
eterzella.r.t
Cacti User


Joined: 25 Oct 2007
Posts: 61

PostPosted: Mon Mar 17, 2008 11:27 pm    Post subject: Reply with quote

When i run php check-uptime.php this error occurred:

root@svr1:/var/www/cacti_original/plugins/uptime# php check-uptime.php

Invalid PHP_SELF Path


Quote:
Cacti Version - 0.8.7b
Plugin Architecture - 2.0
Poller Type - CMD.php
Server Info - Linux 2.6.17-10-server
Web Server - Apache/2.0.55 (Ubuntu) PHP/5.1.6
PHP - 5.1.6
PHP Extensions - xmlwriter, libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, standard, SimpleXML, sockets, soap, SPL, shmop, session, Reflection, posix, mime_magic, mbstring, iconv, hash, gettext, ftp, filepro, exif, dom, dba, date, ctype, calendar, bz2, bcmath, zlib, pcre, openssl, xmlreader, apache2handler, mysql, snmp, mysqli, gd
MySQL - 5.0.24a-Debian_9-log
RRDTool - 1.2.23
SNMP - 5.2.2
Plugins
    Global Plugin Settings (settings - v0.3)
    Thresholds (thold - v0.3.9)
    Network Discovery (discovery - v0.8.3)
    Device Monitoring (monitor - v0.8.2)
    Host Info (hostinfo - v0.2)
    Network Tools (tools - v0.2)
    Device Tracking (mactrack - v1.1)
    FlowView (flowview - v0.4)
    Uptime (uptime - v0.3)
    PHP Network Weathermap (weathermap - v0.95a)
    ReportIt (ReportIt - v0.5.1)
    Report Creator (reports - v0.3)
    Network Management Inventory Database (nmid - v0.3.7g)
    Poller Performance Report (pollperf - v0.32)
    NMID SmokePing Plugin (nmid_smokeping - v0.1)
    NMID NFTracker Plugin (nmid_nftracker - v0.1)
    NMID WebService Plugin (nmid_webservice - v0.1)
    NMID CiscoWorks Plugin (nmid_ciscoworks - v0.1)
    NMID phpIP Plugin (nmidPhpip - v0.3.8a)
    NMID TaskManager Plugin (nmidTaskManager - v0.3.8a)
    IP subnet Calculator IPv4 IPv6 (ipsubnet - v.4d)
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1989
Location: United Kingdom

PostPosted: Tue Mar 18, 2008 3:21 am    Post subject: Reply with quote

eterzella.r.t wrote:
When i run php check-uptime.php this error occurred:

root@svr1:/var/www/cacti_original/plugins/uptime# php check-uptime.php

Invalid PHP_SELF Path



Then don't do that

Seriously, you don't need to. It's not like weathermap's check.php - it's used internally by uptime.
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1989
Location: United Kingdom

PostPosted: Sun Apr 06, 2008 6:53 am    Post subject: Reply with quote

Having found that CentOS 4 seems to restart the snmpd as part of it's weekly maintenance plan, I've made some modifications to check-uptime.php

This modification tried to retrieve the uptime from the HOST-MIB as well as the regular MIB-II one. The one that uptime normally checks is actually the uptime of the SNMP agent, and not the system. Not all devices use HOST-MIB (Cisco routers don't for example), but where both are available this modification prefers the system uptime over the agent uptime.

I haven't tested extensively to see if the extra query that fails slows down the poller too much though. A cleverer version would remember which hosts understand HOST-MIB.

It does stop Cacti sending alerts when the SNMP service is restarted.



check-uptime.php.txt
 Description:

Download
 Filename:  check-uptime.php.txt
 Filesize:  3.64 KB
 Downloaded:  81 Time(s)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 5 of 6

 



Powered by phpBB © 2001, 2005 phpBB Group