Enhancement: Adding SNMP Version to Devices List

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
ddonohue
Cacti User
Posts: 77
Joined: Mon Jul 10, 2006 10:36 am
Contact:

Enhancement: Adding SNMP Version to Devices List

Post by ddonohue »

Hey Guys, so in a few of the places i've worked, we've done migrations from SNMP v1 -> 2 -> 3, and it's hard to tell other then by going into the database and doing a search to find which devices are version 3 compared to that of which devices are version 1 or whatever. Would be nice if you could display the contents of the snmp_version field possibly in the devices tab.

-Dave
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Enhancement: Adding SNMP Version to Devices List

Post by noname »

Though I'm not sure in detail about what you want, how about this?

% mysql -uUSER -pPASS cacti -e 'select id,description,hostname,snmp_version from host;'

Code: Select all

Example:
+----+-------------+--------------+--------------+
| id | description | hostname     | snmp_version |
+----+-------------+--------------+--------------+
|  1 | Localhost   | 127.0.0.1    |            2 |
|  4 | Switch-1    | 192.168.10.1 |            2 |
|  5 | Switch-2    | 192.168.10.2 |            2 |
|  6 | Switch-3    | 192.168.10.3 |            2 |
+----+-------------+--------------+--------------+
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Enhancement: Adding SNMP Version to Devices List

Post by cigamit »

Ideally, the whole device display will be AJaxified and allow you to select any column you would like to display or hide, we just aren't at that point just yet. We also need to make the table display a bit easier for plugins to hook into, because then you could at least write a plugin to display the column for you too.
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Enhancement: Adding SNMP Version to Devices List

Post by noname »

Ah, "in the devices tab" means like this?

Image

host.php:

Code: Select all

function host() {
        ...

        $display_text = array(
                "description" => array("Description", "ASC"),
                "id" => array("ID", "ASC"),
                "nosort1" => array("Graphs", "ASC"),
                "nosort2" => array("Data Sources", "ASC"),
                "status" => array("Status", "ASC"),
                "status_event_count" => array("Event Count", "ASC"),
                "hostname" => array("Hostname", "ASC"),
         --->   "snmp_version" => array("SNMP Version", "ASC"),
         --->   "snmp_port" => array("SNMP Port", "ASC"),
         --->   "snmp_timeout" => array("SNMP Timeout", "ASC"),
                "cur_time" => array("Current (ms)", "DESC"),
                "avg_time" => array("Average (ms)", "DESC"),
                "availability" => array("Availability", "ASC"));

        ...

        if (sizeof($hosts) > 0) {
                foreach ($hosts as $host) {
                        ...
                        form_selectable_cell(...
                 --->   form_selectable_cell($host["snmp_version"], $host["id"]);
                 --->   form_selectable_cell($host["snmp_port"], $host["id"]);
                 --->   form_selectable_cell($host["snmp_timeout"], $host["id"]);
                        form_selectable_cell(round(($host["cur_time"]), 2), $host["id"]);
As cigamit mentioned, it is ideal if we could switch columns on/off dynamically.

(I understand that source modification is not good habit for later (official) patching, but creating plugin is not so easy for me..)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests