Cacti Server Monitoring script for Unix

Addons for Cacti and discussion about those addons

Moderators: Moderators, Developers

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

#16 Post by rony » Thu Oct 26, 2006 2:08 pm

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: 22
Joined: Thu Nov 02, 2006 3:10 am

Can't run this script

#17 Post by bambid » Wed Nov 15, 2006 7:26 am

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: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#18 Post by fmangeant » Wed Nov 15, 2006 8:16 am

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: 22
Joined: Thu Nov 02, 2006 3:10 am

#19 Post by bambid » Wed Nov 15, 2006 2:09 pm

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: 6016
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

#20 Post by rony » Wed Nov 15, 2006 2:53 pm

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: 6016
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

#21 Post by rony » Wed Nov 15, 2006 4:00 pm

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: 22
Joined: Thu Nov 02, 2006 3:10 am

#22 Post by bambid » Wed Nov 15, 2006 7:48 pm

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


Thanks
David

bambid
Posts: 22
Joined: Thu Nov 02, 2006 3:10 am

#23 Post by bambid » Fri Nov 17, 2006 6:18 am

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: 6016
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

#24 Post by rony » Sun Nov 19, 2006 12:16 pm

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: 22
Joined: Thu Nov 02, 2006 3:10 am

#25 Post by bambid » Sun Nov 19, 2006 1:05 pm

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:

#26 Post by SoftDux » Mon Jun 23, 2008 7:26 am

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

#27 Post by shot » Thu Oct 01, 2009 7:17 am

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

#28 Post by erik.costa » Tue May 15, 2012 7:34 am

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

#29 Post by MI1 » Tue Oct 16, 2012 6:09 am

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