summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 745b58a)
raw | patch | inline | side by side (parent: 745b58a)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Thu, 25 Oct 2007 20:43:04 +0000 (20:43 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Thu, 25 Oct 2007 20:43:04 +0000 (20:43 +0000) |
fixes for some help output
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1810 f882894a-f735-0410-b71e-b25c423dba1c
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1810 f882894a-f735-0410-b71e-b25c423dba1c
plugins-root/check_dhcp.c | patch | blob | history | |
plugins/check_ping.c | patch | blob | history | |
plugins/check_ups.c | patch | blob | history | |
tools/sync_website | [new file with mode: 0755] | patch | blob |
index c6e5af8ab7aed93828f49933a1716ca4c638b73e..bc2f4bbed69e0ba89f470403368efd72b3e89dcb 100644 (file)
int dhcp_socket;
int result = STATE_UNKNOWN;
- /* this plugin almost certainly needs root permissions. */
- np_warn_if_not_root();
-
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
usage4 (_("Could not parse arguments"));
}
+ /* this plugin almost certainly needs root permissions. */
+ np_warn_if_not_root();
+
/* create socket for DHCP communications */
dhcp_socket=create_dhcp_socket();
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index bf726d829a85b7d277f035bc4507502adfb8bdf6..065a14c7e5c1f614ad4520bc70df081dc8b2142d 100644 (file)
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
{
print_revision (progname, revision);
- printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>");
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
printf (_("Use ping to check connection statistics for a remote host."));
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 0cd4c5a0a4c1a6212c456e5af2416ae0b0c8f342..832c32b669c7995ffdbbe61ab9827729056ee18f 100644 (file)
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
print_revision (progname, revision);
- printf ("Copyright (c) 2000 Tom Shields");
+ printf ("Copyright (c) 2000 Tom Shields\n");
printf ("Copyright (c) 2004 Alain Richard <alain.richard@equation.fr>\n");
printf ("Copyright (c) 2004 Arnaud Quette <arnaud.quette@mgeups.com>\n");
printf (COPYRIGHT, copyright, email);
diff --git a/tools/sync_website b/tools/sync_website
--- /dev/null
+++ b/tools/sync_website
@@ -0,0 +1,44 @@
+#!/usr/bin/perl
+use strict;
+use DBI;
+#$ENV{PERL5LIB}="plugins-scripts"; # Needed for utils.pm
+
+unless ($ENV{DRUPAL_PASSWORD}) {
+ die "Must set envvar for DRUPAL_PASSWORD";
+}
+
+my $pid = open(F, "-|", qw(ssh -n -N -L 25555:127.0.0.1:3306 nagiosplugins.org));
+
+# Allow time for ssh tunnel to be created
+sleep 2;
+
+# To stop the death of ssh tunnel being defunct
+$SIG{CHLD} = 'IGNORE';
+
+END { kill 'INT', $pid if $pid };
+
+my $dbh = DBI->connect("DBI:mysql:database=drupal;host=127.0.0.1;port=25555", "drupal", $ENV{DRUPAL_PASSWORD});
+
+my @plugin_paths;
+push @plugin_paths, (grep { -x $_ && -f $_ } (<plugins-root/*>, <plugins/*>) );
+
+foreach my $plugin_path (@plugin_paths) {
+ my $plugin = $plugin_path;
+ $plugin =~ s%.*/%%;
+ my $help_option = "--help";
+ $help_option = "-h" if ($plugin eq "check_icmp");
+ my $help = `$plugin_path $help_option` || die "Cannot run $plugin -h";
+ $help =~ s/</</g;
+ $help =~ s/>/>/g;
+
+ my $rows = $dbh->do("UPDATE node SET created=UNIX_TIMESTAMP(NOW()) WHERE title='$plugin'");
+ unless ($rows == 1) {
+ die "Cannot find $plugin in drupal to update - create book page first";
+ }
+
+ $dbh->do("UPDATE node_revisions SET timestamp=UNIX_TIMESTAMP(NOW()), log='Updated by update_online_manpage', teaser='$plugin --help', body=? WHERE title='$plugin'",
+ {},
+ "<pre>".$help."</pre>");
+}
+
+print "Finished\n";