Loading...
 
automatic reports with perfparse Scripts

automatic reports with perfparse

I'm planning to generate some perfparse graphs and then automatically send them to our customers.

I wrote a little shell script, which you can simply add to your crontab.
Needs a little handwork though, but is pretty simple to handle I think.

------------------------
  1. !/bin/sh
  2. Modify the Variables for your prupose
  3. needs curl and uuencode installed

SYSDATE=$(date +%Y%m%d)

  1. Path to save the png Files
LOGPATH=/usr/local/nagios/var

  1. Filename for png Files, sysdate will add a simple timestamp after each
file
FILENAME1=$(echo OBDUDFS1_USERDISK_$SYSDATE.png)

  1. Subject Line for mail
SUBJECT1=$(echo "XXXXXXXXX -" $SYSDATE)

  1. recipients (comma seperated for multiple reciepients)
RECIPIENTS=youremail@yourdomain.com,yoursecondemail

  1. optional, if your nagios needs http authentication
USERNAME=youruser
PASSWORD=yourpassword

  1. URL, which is postet by perfparse
PERFPARSEURL=https://yournagiosserver.xyz/nagios/cgi-bin/perfchart.png?w
hatsoever

          1. nothing needs to be changed below #####

  1. get graph with curl
curl -k -u $USERNAME:$PASSWORD -o $LOGPATH/$FILENAME1 "$PERFPARSEURL"

  1. send the image
uuencode $LOGPATH/$FILENAME1 $FILENAME1 | mail -s "$SUBJECT1"
$RECIPIENTS
------------------------

(From Sand Philipp)
Contributors to this page: ymettier .
Page last modified on Friday 08 of April, 2005 10:08:24 UTC by ymettier.

Shoutbox

redflo, 14:25 UTC, Sun 10 of Apr, 2005: No, lneuxyuhje, this shall write to a pipe not to a file and so ">" is o.k.
lneuxyuhje, 15:14 UTC, Thu 07 of Apr, 2005: is ">" meant to be ">>" in /usr/local/perfparse/bin/perfparse_nagios_pipe_command.pl ?
redflo, 08:35 UTC, Tue 05 of Apr, 2005: fhdplbvjipsld, it works now. Permissions were wrong.
fhdplbvjipsld, 14:42 UTC, Wed 30 of Mar, 2005: How to post to Forums->Help?
benclewett, 09:27 UTC, Thu 03 of Feb, 2005: Hi Jon! I hope you like our wiki site.