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 returned value if $sau is empty #5613

Merged
merged 2 commits into from Dec 13, 2023
Merged

Conversation

xmacan
Copy link
Member

@xmacan xmacan commented Dec 13, 2023

I have few windows servers which stopped or never start working in cacti. It is disk utilization issue.
php ss_host_disk.php 'server_name' '961' '2:11165:1500:3:35:kaktus::::::' index
1
2
3
4
5

php ss_host_disk.php 'server_name' '961' '2:11165:1500:3:35:kaktus::::::' query used
1!4231188
2!0
3!193027394
4!27669
5!36638

php ss_host_disk.php 'server_name' '961' '2:11165:1500:3:35:kaktus::::::' query total
1!15547647
2!0
3!536866303
4!76784
5!65520

Get specific value is problem:
php ss_host_disk.php 'server_name' '961' '2:11165:1500:3:35:kaktus::::::' get total 4
U
php ss_host_disk.php 'server_name' '961' '2:11165:1500:3:35:kaktus::::::' get used 1
U

Problem is here:
var_dump($sau) = string(0) ""
var_dump($snmp_data) = string(8) "20881406"

So these few lines returns 'U'

if ($snmp_data != '' && $snmp_data < 0) {
return (abs($snmp_data) + 2147483647) * $sau;
} elseif (is_numeric($snmp_data) && is_numeric($sau)) {
return $snmp_data * $sau;
} else {
return 'U';
}

Copy link
Member

@TheWitness TheWitness left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires repackaging the various templates using it

@TheWitness TheWitness merged commit eca3e21 into Cacti:1.2.x Dec 13, 2023
6 checks passed
@xmacan
Copy link
Member Author

xmacan commented Dec 13, 2023

I'm busy. Maybe @bmfmancini ?

@TheWitness
Copy link
Member

I can do it. @netniV what do you think?

@netniV
Copy link
Member

netniV commented Dec 14, 2023

What do I think of what?

@bmfmancini
Copy link
Member

bmfmancini commented Dec 14, 2023 via email

@TheWitness
Copy link
Member

@netniV , this change drives the repacking of maybe 6 packages.

@netniV
Copy link
Member

netniV commented Dec 15, 2023

If it's not critical it should wait

@TheWitness
Copy link
Member

It's not.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 16, 2024
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.

None yet

4 participants