Todayyyyy!!! Good news!!!
Thank you very much Victor.
Best regards.
Thank you very much Victor.
Best regards.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuotemake[3]: se ingresa al directorio `/root/netxms-agent/netxms-1.2.9/src/libnetxms'
CXX libnetxms_la-agent.lo
stdin:1: error: character not allowed to start a syntax specifier
make[3]: *** [libnetxms_la-agent.lo] Error 1
Quotereturn GetCustomAttribute($node, "NumFailures");
Quotereturn GetCustomAttribute($node, "mtbf");
Quotereturn GetCustomAttribute($node, "mttr");
Quote// This script calculates MTTR, MTBF and perAvailability parameters and stores them in custom attributes
// Initialize some custom attributes the first time.
// Undefined attributes are created by SetCustomAttribute function automatically
CurrentStatus = GetDCIValue($node, FindDCIByName($node, "Status"));
PreviousState = GetCustomAttribute($node, "PreviousState");
if (PreviousState == null)
{ // In the first time, previous state is null
SetCustomAttribute($node, "PreviousState", CurrentStatus);
SetCustomAttribute($node, "TimeStamp", time());
SetCustomAttribute($node, "NumFailures", 0);
SetCustomAttribute($node, "TotalUptime", 0);
SetCustomAttribute($node, "TotalDowntime", 0);
return 100;
}
// From here the 2nd and subsequent times
NumFailures = GetCustomAttribute($node, "NumFailures");
LastTime = time() - GetCustomAttribute($node, "TimeStamp");
// Status is up
if (CurrentStatus == 0)
{
if (PreviousState != CurrentStatus)
{ // just changed to up
// update mttr
TotalDowntime = GetCustomAttribute($node, "TotalDowntime") + LastTime;
mttr = TotalDowntime / ((NumFailures == 0) ? 1 : NumFailures) / 3600; // to prevent division by ze
SetCustomAttribute($node, "TotalDowntime", TotalDowntime);
SetCustomAttribute($node, "mttr", mttr);
}
else
{ // still up
// update mtbf
TotalUptime = GetCustomAttribute($node, "TotalUptime") + LastTime;
mtbf = TotalUptime / ((NumFailures == 0) ? 1 : NumFailures) / 3600; // to prevent division by zero
SetCustomAttribute($node, "TotalUptime", TotalUptime);
SetCustomAttribute($node, "mtbf", mtbf);
}
}
// Status is down
if (CurrentStatus == 4)
{
if (PreviousState != CurrentStatus)
{ // just changed to down
// update mtbf
NumFailures++;
TotalUptime = GetCustomAttribute($node, "TotalUptime") + LastTime;
mtbf = TotalUptime / NumFailures / 3600;
SetCustomAttribute($node, "NumFailures", NumFailures);
SetCustomAttribute($node, "TotalUptime", TotalUptime);
SetCustomAttribute($node, "mtbf", mtbf);
}
else
{ // still down
// update mttr
TotalDowntime = GetCustomAttribute($node, "TotalDowntime") + LastTime;
mttr = TotalDowntime / NumFailures / 3600;
SetCustomAttribute($node, "TotalDowntime", TotalDowntime);
SetCustomAttribute($node, "mttr", mttr);
}
}
If (CurrentStatus == 0 || CurrentStatus == 4)
{
// Save previous state and timestamp
SetCustomAttribute($node, "PreviousState", CurrentStatus);
SetCustomAttribute($node, "TimeStamp", time());
// perAvailability section
TotalUptime = GetCustomAttribute($node, "TotalUptime");
TotalDowntime = GetCustomAttribute($node, "TotalDowntime");
perAvailability = TotalUptime / (TotalUptime + TotalDowntime) * 100;
SetCustomAttribute($node, "perAvailability", perAvailability);
return perAvailability;
}
QuoteNetXMS 1.2.6 Interactive Shell
>>> import xlrd
>>> help()
Welcome to Python 2.7! This is the online help utility.
If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/tutorial/.
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".
To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics". Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".
help> modules
Please wait a moment while I gather a list of all available modules...
BaseHTTPServer codecs jffi sched
CGIHTTPServer codeop json select
ConfigParser collections keyword sets
Cookie colorsys linecache setuptools
DocXMLRPCServer command locale sgmllib
HTMLParser commands logging sha
MimeWriter compileall macpath shelve
Queue compiler macurl2path shlex
SimpleHTTPServer contextlib mailbox shutil
SimpleXMLRPCServer cookielib mailcap signal
SocketServer copy markupbase site
StringIO copy_reg marshal smtpd
UserDict csv math smtplib
UserList ctypes md5 sndhdr
UserString datetime mhlib socket
_LWPCookieJar dbexts mime sre
_MozillaCookieJar decimal mimetools sre_compile
__builtin__ difflib mimetypes sre_constants
__future__ dircache mimify sre_parse
_abcoll dis modjy ssl
_ast distutils multifile stat
_codecs doctest mutex string
_collections dom netrc struct
_csv dumbdbm new subprocess
_fsum dummy_thread nntplib symbol
_functools dummy_threading nt synchronize
_google_ipaddr_r234 easy_install ntpath sys
_hashlib email nturl2path sysconfig
_io encodings numbers tabnanny
_jyio errno opcode tarfile
_marshal etree operator telnetlib
_py_compile exceptions optparse tempfile
_pyio filecmp os test
_random fileinput parsers tests
_rawffi fnmatch pawt textwrap
_sre formatter pdb this
_strptime fpformat pickle thread
_systemrestart fractions pickletools threading
_threading ftplib pipes time
_threading_local functools pkg_resources timeit
_warnings future_builtins pkgutil token
_weakref gc platform tokenize
_weakrefset genericpath plistlib trace
abc getopt popen2 traceback
aifc getpass poplib tty
anydbm gettext posixfile types
argparse glob posixpath ucnhash
array grp pprint unicodedata
ast gzip profile unittest
asynchat hashlib pstats urllib
asyncore heapq pty urllib2
atexit hmac pwd urlparse
base64 htmlentitydefs py_compile user
bdb htmllib pycimport uu
binascii httplib pyclbr uuid
binhex ihooks pydoc warnings
bisect imaplib pyexpat weakref
bz2 imghdr quopri whichdb
cPickle imp random wsgiref
cStringIO importlib re xdrlib
calendar inspect readline xlrd
cgi io repr xml
cgitb isql rfc822 xmllib
chunk itertools rlcompleter xmlrpclib
cmath jarray robotparser zipfile
cmd javapath runpy zipimport
code javashell sax zlib
Enter any module name to get more help. Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".
help>
QuoteNetXMS 1.2.5 Interactive Shell
>>> help()
Welcome to Python 2.5! This is the online help utility.
Quote# Check_db.sh
#
# Check, repair and backup netxms database in remote host
#
### Variables ###
date=`date +%d-%m-%Y`
DateTimeStamp="date +%d/%m/%Y-%H:%M:%S"
# Paths
logfile="/var/log/mysql_backup.log"
tempbackdir="/tmp"
remotebackdir="/datos/backup/mysql_netxms_pro"
sourcedir="/var/lib/mysql"
### Check and repair data base ###
### First stop netxms agent and server, and then repair netxms data base using nxdbmgr
/usr/bin/killall nxagentd >> $logfile
/usr/bin/killall netxmsd >> $logfile
/usr/local/bin/nxdbmgr -f check >> $logfile
sleep 60
### Repair all mysql database (-Avrs parametres can be different depending on mysql version)
echo "#################################################" >> $logfile
echo `$DateTimeStamp` - All processes have been stopped. Analysis and repair MySQL DB started: >> $logfile
/usr/bin/mysqlcheck -Avrs -uroot -pxxxxxxxxx >> $logfile
### Backup databases locally whit compression ###
### Stop mysqld deamon
/sbin/service mysqld stop
sleep 60
### Compress with tar command
echo `$DateTimeStamp` - MySQL databases backup started: >> $logfile
tar -pcjvf $tempbackdir/mysql_backup-$date.tar.bz2 $sourcedir/ ### >> $logfile
tar -tjvf $backdir/mysql_backup-$date.tar.bz2 $sourcedir/ ### >> $logfile
sleep 60
/sbin/service mysqld start >> $logfile
/usr/local/bin/netxmsd -d >> $logfile
/usr/local/bin/nxagentd -d >> $logfile
echo `$DateTimeStamp` - MySQL databases backup completed. All netxms processes have been started >> $logfile
### Move local backup to remote server # # #
### Note that the remote server must contain the server's public key (generated with the
###"ssh-keygen-t rsa" command) from which you send the backup in
###"$HOME/.ssh/authorized_keys" file
scp $tempbackdir/mysql_backup-$date.tar.bz2 [email protected]:$remotebackdir >> $logfile
echo `$DateTimeStamp` - Local backup has been moved to remote server >> $logfile
### Remove daily backups over 32 days old on the remote server ###
ssh [email protected] find $remotebackdir/ -name '*.tar.bz2' -type f -mtime +32 -exec "rm -f {} \;" >> $logfile
echo `$DateTimeStamp` - Remote backups over 32 days old have been removed >> $logfile
echo "###" >> $logfile
echo "###" >> $logfile
exit 0
Quote00 3 * * * /usr/local/scripts/Check_db.sh
QuoteIs it for all addresses or only for some?This happens with every address (IP/MAC) I've tried to find.
QuoteWhat switches you are using in your network?Cisco Nexus n5000, Cisco Nexus 1010, Cisco Nexus 1000, Cisco Catalyst 4500, Cisco Catalyst s72033, Cisco Catalyst C3750E, Cisco Catalyst C3500XL, Cisco 2801, Cisco Catalyst c6sup2_rp, Cisco Catalyst C2950, Cisco Catalyst C2970, Cisco Catalyst CBS31X0, HP Procurve 2810-24G, HP Procurve 1810G, HP Procurve 2910al-48G, HP Procurve 2650, HP Procurve 2824, etc.
QuoteIs it possible to read forwarding database from switches (Tools -> Info -> Switch forwarding database)?Yes for:
QuoteConnection point information cannot be found