1 Nagios_Hostname = trim(`hostname`); 89 } else { 90 $this->Nagios_Hostname = trim($NagiosHostInConfig); 91 } 92 93 $this->Hosts = Array(); 94 $this->Comments = Array(); 95 96 return true; 97 } 98 99 public function CreateErrorToken($ErrorDescription) 100 { 101 /* 102 * CreateErrorToken() 103 * Create an output return token with error information 104 */ 105 106 $ErrorText = base64_encode($ErrorDescription); 107 $ErrorTextChecksum = md5($ErrorText); 108 echo "**NLGPOLLER!!" . $this->Poller_Version . "!!" . $this->Nagios_Hostname . "!!FALSE!!" . $ErrorText . "!!" . $ErrorTextChecksum . "!!NLGPOLLE R**"; 109 exit(1); 110 } 111 112 public function CreateOutputToken() 113 { 114 /* 115 * CreateErrorToken() 116 * Create an output return token with all current data 117 */ 118 119 $OutputText = base64_encode(serialize($this)); 120 $OutputTextChecksum = md5($OutputText); 121 echo "**NLGPOLLER!!" . $this->Poller_Version . "!!" . $this->Nagios_Hostname . "!!TRUE!!" . $OutputText . "!!" . $OutputTextChecksum . "!!NLGPOLL ER**"; 122 exit(0); 123 } 124 } 125 126 class S3_NagiosHost 127 { 128 /* 129 * S3_NagiosHost() 130 * The host template class 131 */ 132 133 public $HostID; 134 public $GroupID; 135 public $HostName; 136 public $HostStatus; 137 public $LastCheck; 138 public $NextCheck; 139 public $CheckResult; 140 public $HostServices; 141 public $ServiceCount_Total; 142 public $ServiceCount_OK; 143 public $ServiceCount_Warn; 143 public $ServiceCount_Warn; 144 public $ServiceCount_Fail; 145 public $ServiceCount_Unknown; 146 public $RequiredInFilter = true; 147 public $RequiredInGroup = true; 148 } 149 150 class S3_NagiosService 151 { 152 /* 153 * S3_NagiosService() 154 * The service template class 155 */ 156 157 public $ServiceID; 158 public $HostID; 159 public $ServiceName; 160 public $ServiceStatus; 161 public $LastCheck; 162 public $NextCheck; 163 public $CheckResult; 164 } 165 166 class S3_NagiosComment 167 { 168 /* 169 * S3_NagiosComment() 170 * Any comment starting with NLG# is passed back to the client 171 */ 172 173 // Nagios host comments 174 175 public $CommentID; 176 public $Type; 177 public $Host; 178 public $Service; 179 public $EntryTime; 180 public $Author; 181 public $CommentText; 182 } 183 184 class S3_NetworkFilter 185 { 186 public $FilterDisplayText; 187 private $FilterHostsToInclude; 188 189 function Create($DisplayText) 190 { 191 /* 143,27-28