Cacti Server Monitoring script for Unix

Addons for Cacti and discussion about those addons

Moderators: Developers, Moderators

User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Added another updated version.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
bambid
Posts: 23
Joined: Thu Nov 02, 2006 3:10 am

Can't run this script

Post by bambid »

Error message :

bash: ./cacti_monitor.sh: /bin/bash^M: bad interpreter: No such file or directory

I have mail and mailx, path to bash is OK, what can be wrong ?

Thanks for reply
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

can you try this :

Code: Select all

$ dos2unix cacti_monitor.sh
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
bambid
Posts: 23
Joined: Thu Nov 02, 2006 3:10 am

Post by bambid »

I tried that and got this message :

dos2unix: converting file casti_monitor.sh to UNIX format ...
dos2unix: problems converting file casti_monitor.sh
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Let me repost in a non-broken format... :(
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Latest version has been cleaned of the annoying carriage returns.. :)

Sorry about that... :oops:
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
bambid
Posts: 23
Joined: Thu Nov 02, 2006 3:10 am

Post by bambid »

I tried that and now it runs without any error message.


Thanks
David
bambid
Posts: 23
Joined: Thu Nov 02, 2006 3:10 am

Post by bambid »

I have problem with this script. Today I got bunch of emails at the same time, beginning of email is same, but section with issue is different:

Code: Select all

The following issues are present on the Cacti Server:

 ERROR: Cacti poller goes not seem to be running
        Recommended action: Investigate why the poller is not running properly

 ERROR: Cacti poller goes not seem to be running
        Recommended action: Investigate why the poller is not running properly
In one email are this ERROR s three, in one email is ERROR missing.
David
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Um....

What version of the script are you running?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
bambid
Posts: 23
Joined: Thu Nov 02, 2006 3:10 am

Post by bambid »

Hi Rony,
I use version 1.0.2 .
David
SoftDux
Posts: 39
Joined: Thu Jun 19, 2008 9:24 am
Location: Johannesburg, South Africa
Contact:

Post by SoftDux »

Does / can it email you when certain things happen, like host / http / mysql /etc down, or HDD filling up, etc?
shot
Posts: 2
Joined: Thu Oct 01, 2009 6:47 am

Post by shot »

Could you please post a output of your script for example?
erik.costa
Posts: 12
Joined: Mon Feb 07, 2011 9:01 am

Re: Cacti Server Monitoring script for Unix

Post by erik.costa »

Thanks for sharing!

Its working great here!
MI1
Posts: 30
Joined: Tue Aug 21, 2012 2:23 am

Re: Cacti Server Monitoring script for Unix

Post by MI1 »

Something is bad, I do have postfix and sendmail on the server, when trying to run the script i get this:

Code: Select all

:/home/scripts# ./cacti_monitor.sh
postdrop: warning: unable to look up public/pickup: No such file or directory
srvr:/home/scripts# whoami
root
Do I need to make some changes and pickup mail server directly?

Edit: error above seems to be fixed with:

Code: Select all

mkfifo /var/spool/postfix/public/pickup
but still no emails received when 5 percent is choosen.

Code: Select all

### Enable disk monitoring ###
CHECK_DISK="YES";
# Percent of volume usage to alert on, whole integer number
TOLERANCE_PERCENT="5";
My disk has 80 percent used of course.

Edit: I am idiot, script was ok, but external SMTP was required. One more hint, on some servers consider changing httpd to apache inside script.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests