Skip to content

Allow command line reindex to work with disabled devices #4193

@zuka1337

Description

@zuka1337

Describe the bug

When running poller_reindex_hosts.php script I've noticed that it try to reindex disabled devices.

To Reproduce

Steps to reproduce the behavior:

Run the script with:
/usr/bin/php poller_reindex_hosts.php --id=all --qid=all --debug
grep any disabled devices id

Expected behavior

Expect to reindex only enabled devices

I tryed this:

/* determine the hosts to reindex */
if (strtolower($host_id) == 'all') {
        $sql_where = '';
}else if (is_numeric($host_id) && $host_id > 0) {
        $sql_where = 'WHERE host_id = ' . $host_id . "'AND disabled NOT LIKE 'on'"; <---
} else {
        print "ERROR: You must specify either a host_id or 'all' to proceed.\n";
        display_help();
        exit;
}

Does not work..

Cacti 1.2.16
Centos 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions