Differences between revisions 1 and 2
Revision 1 as of 2006-04-24 17:37:22
Size: 791
Editor: FelixFrank
Comment:
Revision 2 as of 2006-04-24 17:39:14
Size: 788
Editor: FelixFrank
Comment:
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
1. Queries for RPM packages. The initial idea was a construct like {{{ map { chomp; $installed{$_} = 1 } `$rpm -qa`;
}}} which would have allowed a fast and elegant check like `use_service($service_name) if $installed{$package};`.
This would, however, require exact package names including version numbers in '''announce_nagios''' (like `firefox-1.0.8-1.4.1.SL3.1.i386`). [[BR]]
So i chose a different mode of retrieval of the packages installed: {{{ my $installed = 'XxX'.`$rpm -qa`;
 1. Queries for RPM packages. The initial idea was a construct like {{{ map { chomp; $installed{$_} = 1 } `$rpm -qa`;
}}} which would have allowed a fast and elegant check like `use_service($service_name) if $installed{$package};`. This would, however, require exact package names including version numbers in '''announce_nagios''' (like `firefox-1.0.8-1.4.1.SL3.1.i386`). [[BR]]So i chose a different mode of retrieval of the packages installed: {{{ my $installed = 'XxX'.`$rpm -qa`;

Felix Frank

Email: MailTo(ffrank@ifh.de)

Design decisions

announce_services

  1. Queries for RPM packages. The initial idea was a construct like {{{ map { chomp; $installed{$_} = 1 } $rpm -qa;

}}} which would have allowed a fast and elegant check like use_service($service_name) if $installed{$package};. This would, however, require exact package names including version numbers in announce_nagios (like firefox-1.0.8-1.4.1.SL3.1.i386). BRSo i chose a different mode of retrieval of the packages installed: {{{ my $installed = 'XxX'.$rpm -qa; $installed =~ s/\n/XxX/g; }}} to allow a more flexible, yet slower query like use_service($service_name) if $installed =~ /XxX$package/;


CategoryHomepage

FelixFrank (last edited 2008-11-03 12:39:23 by FelixFrank)