Skip to content

Functions listHosts/getHostById/deleteHostById working#15

Open
IPv777 wants to merge 20 commits intoEyesOfNetworkCommunity:masterfrom
IPv777:master
Open

Functions listHosts/getHostById/deleteHostById working#15
IPv777 wants to merge 20 commits intoEyesOfNetworkCommunity:masterfrom
IPv777:master

Conversation

@IPv777
Copy link

@IPv777 IPv777 commented Feb 5, 2020

I created the function listHosts to return all the hosts of Nagios

@davoult davoult self-assigned this Feb 5, 2020
@IPv777 IPv777 changed the title Function listHosts working Functions listHosts/getHostById/deleteHostById working Feb 10, 2020
@IPv777
Copy link
Author

IPv777 commented Feb 10, 2020

I created the functions getHostById and deleteHostById (the Nagios ID of host)

$success .= "Parent added";
}

if( $exportConfiguration == TRUE )

Choose a reason for hiding this comment

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

No need to test a value of a boolean: if($exportConfiguration)
is enough isn't it?


return true;

return $this->listNagiosObjects("hosts")["default"];

Choose a reason for hiding this comment

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

I would add a defense on the "default" key, in the doubt that the returned array is empty.

$error.= "That parent relationship does not exist yet.\n";
}

if( $exportConfiguration == TRUE )

Choose a reason for hiding this comment

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

No need to test a value of a boolean: if($exportConfiguration)
is enough isn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments