Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Status is OK #1

Open
wh1test opened this issue Oct 31, 2013 · 8 comments
Open

Status is OK #1

wh1test opened this issue Oct 31, 2013 · 8 comments

Comments

@wh1test
Copy link

wh1test commented Oct 31, 2013

Hi! You created very intresting plugin for Nagios. I installed your plugin exactly as you discribed in readme file. All nessesary perl modules installed too. My enviroment is Centos 5.9 i386, switch Cisco 2960 and check_cisco_config v.0.3. However when I execute the command I receive "Status is OK" all times:

./check_cisco_config.pl -H 10.15.222.55 -C snmpsecret -I 10.15.2.2 -T running -L /usr/local/nagios/cisco_configs -l /usr/local/nagios/tftp

Status is OK

Even I make changes in switch configuration and repite command I receive the same status! Here is content of folders:

ls -l /usr/local/nagios/cisco_configs/

total 4
drwxrwxrwx 2 nagios nagios 4096 Oct 31 21:59 10.15.222.55

ls -l /usr/local/nagios/tftp/

total 0

When I tried to use check_cisco_config v.0.2 I recieved:
TFTP transfer timed out after 30 seconds

Could you please ask how to resolve ?
Best regards, Yury

@mrpaulmanley
Copy link
Owner

what are the contents of /usr/local/nagios/cisco_configs/10.15.222.55?

@wh1test
Copy link
Author

wh1test commented Nov 3, 2013

ls -l /usr/local/nagios/cisco_configs/10.15.222.55

total 0
-rwxrwxrwx 1 nagios nagios 0 Oct 31 20:27 10.15.222.55-confg-current

cat /usr/local/nagios/cisco_configs/10.15.222.55/10.15.222.55-confg-current

Output of 10.15.222.55-confg-current always empty.

@mrpaulmanley
Copy link
Owner

Looks like your configuration is not making it to the tftp server. Can you test manually sending your running config to the tftp server? From your 2960, copy running-config tftp and see what happens.

@wh1test
Copy link
Author

wh1test commented Nov 3, 2013

Hmm.. When I try to copy cfg I receive timeout. I can see these messeges in /var/log/messages:
Nov 3 21:02:42 nagios-srv in.tftpd[7209]: cannot set groups for user nobody

@wh1test
Copy link
Author

wh1test commented Nov 3, 2013

Yes! It's works! I just changed config tftp to this:
{
socket_type = dgram
protocol = udp
port = 69
wait = yes
user = root
group = root
server = /usr/sbin/in.tftpd
server_args = -c -s /usr/local/nagios/tftp
disable = no
}

@mrpaulmanley
Copy link
Owner

Awesome. I need to add some logic to detect empty and incomplete files.

@virusmoere
Copy link

Hey,

thanks for the Script!

Any news on "I need to add some logic to detect empty and incomplete files."?

@mrpaulmanley
Copy link
Owner

@virusmoere I haven't been using this plugin for a while, but i could give you some direction on this if you're comfortable implementing. I haven't tested this, but have done something similar in another script to parse the last line of a file.

in sub tftp_config add the following after the line with sleep (20);

#check if the last line of the config is "end" exit with critical status if not
  $lastline = `tail -1 $tftp_path . '/' . $device_name . "-confg-temp"`;
  chomp($lastline);
  if ($lastline neq 'end') {
    print "Incomplete configuration\n";
    #nagios interprets exit code of 2 as critical
    exit 2;
  }  

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants