1212use gipfl \ZfDbStore \DbStorableInterface ;
1313use gipfl \ZfDbStore \NotFoundError ;
1414use gipfl \ZfDbStore \ZfDbStore ;
15- use Icinga \Chart \Inline \Inline ;
1615use Icinga \Module \Eventtracker \Data \PlainObjectRenderer ;
1716use Icinga \Module \Eventtracker \Db \ConfigStore ;
1817use Icinga \Module \Eventtracker \Engine \Downtime \DowntimeRule ;
1918use Icinga \Module \Eventtracker \Engine \Input \KafkaInput ;
20- use Icinga \Module \Eventtracker \Modifier \Modifier ;
2119use Icinga \Module \Eventtracker \Modifier \ModifierRuleStore ;
22- use Icinga \Module \Eventtracker \Modifier \ModifierChain ;
23- use Icinga \Module \Eventtracker \Modifier \RuleStore ;
2420use Icinga \Module \Eventtracker \Modifier \Settings ;
25- use Icinga \Module \Eventtracker \Syslog \SyslogParser ;
2621use Icinga \Module \Eventtracker \Web \Dashboard \ConfigurationDashboard ;
27- use Icinga \Module \Eventtracker \Web \Form \ChannelConfigForm ;
2822use Icinga \Module \Eventtracker \Web \Form \ChannelRuleForm ;
2923use Icinga \Module \Eventtracker \Web \Form \DowntimeForm ;
3024use Icinga \Module \Eventtracker \Web \Form \SimulateRuleForm ;
3832use Icinga \Module \Eventtracker \Web \WebActions ;
3933use Icinga \Web \Notification ;
4034use Icinga \Web \Session \SessionNamespace ;
41- use ipl \Html \FormElement \SubmitButtonElement ;
42- use ipl \Html \FormElement \SubmitElement ;
4335use ipl \Html \Html ;
4436use ipl \Html \Table ;
4537use Ramsey \Uuid \Uuid ;
4638use Ramsey \Uuid \UuidInterface ;
47- use function _PHPStan_90b10482a \React \Async \waterfall ;
48- use function ipl \Stdlib \get_php_type ;
4939
5040class ConfigurationController extends Controller
5141{
@@ -175,7 +165,6 @@ public function channelAction()
175165 public function channelrulesAction ()
176166 {
177167 $ this ->notForApi ();
178- // $this->add
179168 $ action = $ this ->actions ->get ('channels ' );
180169 $ this ->channelTabs ()->activate ('rules ' );
181170 $ this ->actions ()->add (Link::create ($ this ->translate ('Add Modifier ' ), Url::fromPath (
@@ -217,8 +206,7 @@ public function channelrulesAction()
217206 ['uuid ' => $ this ->requireUuid (),
218207 'action ' => 'stop_simulation ' ]
219208 )));
220- }
221- else if ($ this ->params ->get ('action ' ) === 'load_simulation ' ) {
209+ } elseif ($ this ->params ->get ('action ' ) === 'load_simulation ' ) {
222210 $ simulationForm = new SimulateRuleForm ($ ns , $ sessionKey );
223211 $ simulationForm ->handleRequest ($ this ->getServerRequest ());
224212 if ($ simulationForm ->hasBeenSubmitted ()) {
@@ -665,8 +653,12 @@ protected function putHostListMembers()
665653 $ this ->sendJsonSuccess (['message ' => sprintf ('updated %s hosts ' , $ cnt )], 201 );
666654 }
667655
668- protected function showRules (ModifierRuleStore $ modifierRuleStore , SessionNamespace $ ns , UuidInterface $ uuid , UuidObjectForm $ form )
669- {
656+ protected function showRules (
657+ ModifierRuleStore $ modifierRuleStore ,
658+ SessionNamespace $ ns ,
659+ UuidInterface $ uuid ,
660+ UuidObjectForm $ form
661+ ) {
670662 $ sessionKey = 'channelrules/ ' . $ uuid ->toString ();
671663 $ form ->addElement ('submit ' , 'add_modifier ' , []);
672664
@@ -696,7 +688,6 @@ protected function showRules(ModifierRuleStore $modifierRuleStore, SessionNamesp
696688 return ;
697689 }
698690 try {
699- //$modifiers = ModifierChain::fromSerialization($modifierRuleStore->getRules());
700691 $ modifiers = $ modifierRuleStore ->getRules ();
701692 } catch (JsonDecodeException $ e ) {
702693 $ this ->content ()->add (Hint::error (sprintf (
@@ -705,8 +696,6 @@ protected function showRules(ModifierRuleStore $modifierRuleStore, SessionNamesp
705696 )));
706697 return ;
707698 }
708- // $ns->set('channelrules/' . $uuid->toString(), 'test');
709- // $ns->get()
710699 $ url = Url::fromPath ('eventtracker/configuration/channelrule ' , [
711700 'uuid ' => $ uuid ->toString ()
712701 ]);
@@ -744,46 +733,6 @@ protected function showRules(ModifierRuleStore $modifierRuleStore, SessionNamesp
744733 ]);
745734 }
746735
747- protected function getSampleObject ()
748- {
749- return SyslogParser::parseLine (
750- 'Jan 11 13:12:54 goj oem_syslog[2837832]: timestamp=2025-01-11T12:12:54.560Z '
751- . ' hostname=kri.example.com component=kri.example.com id=2837644 state=nok severity=2 oem_clear=false '
752- . ' oem_host_name=kri.example.com oem_incident_ack_by_owner=no url=https://ip.gelf.net oem_incident_id=4996 '
753- . ' oem_incident_status=new '
754- . ' oem_issue_type=incident oem_target_name=kri.example.com oem_target_type=host msg=Alert; Value=7; '
755- . ' String <Returncode:> with values <> 0 found in /var/log/dbms/load_dbclone_for_oracle_mssql.log! '
756- . ' OEMIncidentID: 4996 '
757- );
758- return SyslogParser::parseLine (
759- 'Jan 11 13:12:54 goj oem_syslog[2837832]: timestamp=2025-01-11T12:12:54.560Z '
760- . ' hostname=kri.example.com component=kri.example.com id=2837644 state=nok severity=2 oem_clear=false '
761- . ' oem_host_name=kri.example.com oem_incident_ack_by_owner=no oem_incident_id=4996 oem_incident_status=new '
762- . ' oem_issue_type=incident oem_target_name=kri.example.com oem_target_type=host msg=Alert; Value=7; '
763- . ' String <Returncode:> with values <> 0 found in /var/log/dbms/dbclone_for_oracle_mssql.log! '
764- . ' OEMIncidentID: 4996 '
765- );
766- return JsonString::decode (
767- '{ ' . "\n"
768- . ' "host_name": "goj", ' . "\n"
769- . ' "object_name": "oem_syslog", ' . "\n"
770- . ' "object_class": "user", ' . "\n"
771- . ' "severity": "critical", ' . "\n"
772- . ' "priority": null, ' . "\n"
773- . ' "message": "timestamp=2025-02-02T13:24:30.276Z hostname=atb.example.com '
774- . ' component=DBMS03_SITE1.EXAMPLE id=125690 state=nok severity=1 oem_clear=false '
775- . ' oem_host_name=atb.example.com oem_incident_ack_by_owner=no oem_incident_id=144826 '
776- . ' oem_incident_status=new oem_issue_type=incident oem_target_name=dbms03_site1.example '
777- . ' oem_target_type=oracle_pdb msg=The pluggable database DBMS03_SITE1.EXAMPLE is down. '
778- . ' OEMIncidentID: 144826", ' . "\n"
779- . ' "attributes": { ' . "\n"
780- . ' "syslog_sender_pid": 125795 ' . "\n"
781- . ' } ' . "\n"
782- . '} ' . "\n"
783- );
784- return null ;
785- }
786-
787736 protected function showList (WebAction $ action )
788737 {
789738 $ this ->setAutorefreshInterval (15 );
0 commit comments