Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cli scripts #5729

Merged
merged 2 commits into from
Apr 15, 2024
Merged

Fix cli scripts #5729

merged 2 commits into from
Apr 15, 2024

Conversation

xmacan
Copy link
Member

@xmacan xmacan commented Apr 15, 2024

Script change_device.php has error:
PHP Warning: Undefined array key "ip" in /usr/local/share/cacti_develop/cli/change_device.php on line 370
In scripts is used variable $ip instead of $hostname. I don't want to change it. So only small fix.

Script add_device.php - PHP 8 issue. Without define --template=X is $template_id defaulted from settings and it could be string(0) ""
It is incorrect compare here:
if (!isset($host_templates[$template_id])) {
}
ERROR: Unknown template id ()

array(2) {
[0]=>
string(4) "None"
[1]=>
string(19) "Generic SNMP Device"

@xmacan
Copy link
Member Author

xmacan commented Apr 15, 2024

Found more.... wait with approve

@xmacan
Copy link
Member Author

xmacan commented Apr 15, 2024

done

@TheWitness TheWitness merged commit bcb9554 into Cacti:1.2.x Apr 15, 2024
5 of 6 checks passed
TheWitness pushed a commit that referenced this pull request Apr 15, 2024
* fix php8 issue - int vs. string compare
fix incorrect variable

* incorrect variable name
@github-actions github-actions bot locked and limited conversation to collaborators Jul 15, 2024
@xmacan xmacan deleted the fix_ip_vs_hostname branch October 23, 2024 18:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants