Skip to content

When storage units is blank, return correct response#5613

Merged
TheWitness merged 2 commits intoCacti:1.2.xfrom
xmacan:fix_ss_host_disk
Dec 13, 2023
Merged

When storage units is blank, return correct response#5613
TheWitness merged 2 commits intoCacti:1.2.xfrom
xmacan:fix_ss_host_disk

Conversation

@xmacan
Copy link
Copy Markdown
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';
}

@xmacan xmacan requested a review from TheWitness December 13, 2023 11:41
Copy link
Copy Markdown
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
@xmacan
Copy link
Copy Markdown
Member Author

xmacan commented Dec 13, 2023

I'm busy. Maybe @bmfmancini ?

@TheWitness
Copy link
Copy Markdown
Member

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

@netniV
Copy link
Copy Markdown
Member

netniV commented Dec 14, 2023

What do I think of what?

@bmfmancini
Copy link
Copy Markdown
Member

bmfmancini commented Dec 14, 2023 via email

@TheWitness
Copy link
Copy Markdown
Member

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

@netniV
Copy link
Copy Markdown
Member

netniV commented Dec 15, 2023

If it's not critical it should wait

@TheWitness
Copy link
Copy Markdown
Member

It's not.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 16, 2024
@netniV netniV changed the title fix returned value if $sau is empty When storage units is blank, return correct response Apr 28, 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.

4 participants